/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --spider-red: #e62429;
    --spider-blue: #2163b2;
    --spider-dark: #151515;
    --christmas-green: #1a7a1a;
    --christmas-gold: #ffd700;
    --christmas-red: #d10000;
    --snow-white: #f0f8ff;
    --text-light: #ffffff;
    --text-dark: #333333;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Rubik', sans-serif;
    background: linear-gradient(135deg, var(--spider-dark) 0%, #0a1a2d 50%, #1a0033 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--spider-dark), #0a1a2d);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease-out;
}

.loader {
    text-align: center;
}

.web-swing {
    position: relative;
    width: 100px;
    height: 200px;
    margin: 0 auto 30px;
}

.spider-line {
    position: absolute;
    width: 2px;
    height: 180px;
    background: linear-gradient(to bottom, transparent, var(--snow-white), transparent);
    left: 50%;
    transform: translateX(-50%);
    animation: webSwing 2s infinite ease-in-out;
}

.spider {
    position: absolute;
    width: 30px;
    height: 40px;
    background: var(--spider-red);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: spiderMove 2s infinite ease-in-out;
}

.loader p {
    font-family: 'Bangers', cursive;
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: var(--christmas-gold);
    text-shadow: 0 0 10px var(--spider-red);
}

/* Main Container */
.main-container {
    opacity: 0;
    animation: fadeIn 1s ease-out 0.5s forwards;
}

/* Background Elements */
#snowCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.cityscape {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(transparent, rgba(10, 26, 45, 0.8)), 
                repeating-linear-gradient(90deg, 
                    transparent 0px, 
                    transparent 20px, 
                    rgba(255, 255, 255, 0.05) 20px, 
                    rgba(255, 255, 255, 0.05) 40px
                );
    z-index: 2;
}

.parallax-buildings {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 300px;
    background-image: 
        linear-gradient(transparent 70%, rgba(10, 26, 45, 0.9)),
        radial-gradient(ellipse at 20% 80%, rgba(230, 36, 41, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(33, 99, 178, 0.1) 0%, transparent 50%);
    z-index: 1;
}

/* Spider-Man Animation */
.spiderman-swing {
    position: fixed;
    top: -100px;
    left: -100px;
    z-index: 10;
    pointer-events: none;
    transition: transform 0.3s ease-out;
}

.web-line {
    position: absolute;
    width: 2px;
    height: 800px;
    background: linear-gradient(to bottom, transparent 10%, var(--snow-white) 50%, transparent 90%);
    transform-origin: top center;
    transform: rotate(30deg);
    filter: drop-shadow(0 0 5px var(--snow-white));
}

.spiderman-figure {
    position: absolute;
    width: 80px;
    height: 120px;
    top: 200px;
    left: -35px;
    transform: rotate(-20deg);
    animation: spidermanSwing 3s infinite ease-in-out;
}

.spiderman-figure .head {
    position: absolute;
    width: 40px;
    height: 40px;
    background: var(--spider-red);
    border-radius: 50%;
    top: 0;
    left: 20px;
}

.spiderman-figure .body {
    position: absolute;
    width: 50px;
    height: 60px;
    background: var(--spider-red);
    top: 35px;
    left: 15px;
    border-radius: 20px 20px 10px 10px;
}

.spiderman-figure .body::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 30px;
    background: var(--spider-blue);
    top: 5px;
    left: 5px;
    border-radius: 15px;
}

.spiderman-figure .arm {
    position: absolute;
    width: 20px;
    height: 50px;
    background: var(--spider-red);
    top: 40px;
}

.spiderman-figure .arm.left {
    left: 0;
    transform: rotate(-30deg);
}

.spiderman-figure .arm.right {
    right: 0;
    transform: rotate(30deg);
}

.spiderman-figure .leg {
    position: absolute;
    width: 20px;
    height: 40px;
    background: var(--spider-red);
    bottom: 0;
}

.spiderman-figure .leg.left {
    left: 15px;
    transform: rotate(-10deg);
}

.spiderman-figure .leg.right {
    right: 15px;
    transform: rotate(10deg);
}

/* Header Styles */
.main-header {
    position: relative;
    text-align: center;
    padding: 40px 20px 20px;
    z-index: 5;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.spider-logo {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, var(--spider-red) 40%, transparent 41%);
    position: relative;
}

.spider-logo::before,
.spider-logo::after {
    content: '';
    position: absolute;
    background: var(--spider-red);
    border-radius: 10px;
}

.spider-logo::before {
    width: 80px;
    height: 10px;
    top: 25px;
    left: -10px;
}

.spider-logo::after {
    width: 10px;
    height: 80px;
    left: 25px;
    top: -10px;
}

.title {
    font-family: 'Bangers', cursive;
    font-size: 3.5rem;
    background: linear-gradient(45deg, var(--spider-red), var(--christmas-gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 3px 3px 0 var(--spider-dark),
                 6px 6px 0 rgba(255, 215, 0, 0.3);
    letter-spacing: 3px;
    animation: titleGlow 3s infinite alternate;
}

.header-subtitle {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 1.8rem;
    color: var(--christmas-gold);
    text-shadow: 2px 2px 4px var(--shadow-color);
}

/* Greeting Card */
.greeting-container {
    max-width: 1000px;
    margin: 0 auto 60px;
    padding: 0 20px;
    position: relative;
    z-index: 5;
}

.greeting-card {
    background: linear-gradient(145deg, 
                rgba(21, 21, 21, 0.9) 0%, 
                rgba(33, 99, 178, 0.1) 50%, 
                rgba(230, 36, 41, 0.1) 100%);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    border: 3px solid transparent;
    background-clip: padding-box;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
                inset 0 0 50px rgba(230, 36, 41, 0.2);
}

.greeting-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, 
                var(--spider-red), 
                var(--christmas-gold), 
                var(--spider-blue), 
                var(--christmas-green));
    z-index: -1;
    border-radius: 27px;
    animation: borderGlow 4s linear infinite;
    background-size: 400% 400%;
}

.card-header {
    padding: 30px 40px 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.avatar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-bottom: 20px;
    position: relative;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--spider-blue), var(--spider-red));
    position: relative;
    border: 3px solid var(--christmas-gold);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.avatar:hover {
    transform: scale(1.1) rotate(10deg);
}

.avatar.ammu::before {
    content: 'Ammu';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Mountains of Christmas', cursive;
    color: var(--christmas-gold);
    font-size: 1.2rem;
    white-space: nowrap;
}

.avatar.vassu::before {
    content: 'Vassu';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Mountains of Christmas', cursive;
    color: var(--christmas-gold);
    font-size: 1.2rem;
    white-space: nowrap;
}

.heart-pulse {
    position: absolute;
    font-size: 2rem;
    color: var(--spider-red);
    animation: heartbeat 1.5s infinite;
}

.card-header h2 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.5rem;
    color: var(--christmas-gold);
    text-align: center;
    margin-top: 10px;
}

/* Card Content */
.card-content {
    padding: 30px 40px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

.message-section {
    font-size: 1.1rem;
    line-height: 1.8;
}

.greeting-text {
    font-size: 1.3rem;
    color: var(--christmas-gold);
    margin-bottom: 20px;
}

.special-message {
    background: rgba(230, 36, 41, 0.1);
    border-left: 4px solid var(--spider-red);
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 15px 15px 0;
    position: relative;
}

.message-icon {
    position: absolute;
    top: -15px;
    left: -15px;
    background: var(--spider-red);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.signature {
    text-align: right;
    font-style: italic;
    color: var(--spider-blue);
    margin-top: 15px;
    font-weight: 600;
}

.wish-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 25px 0;
}

.wish-item {
    background: rgba(255, 215, 0, 0.1);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s ease;
}

.wish-item:hover {
    transform: translateY(-5px);
    background: rgba(230, 36, 41, 0.2);
}

.wish-item i {
    color: var(--christmas-gold);
    font-size: 1.2rem;
}

/* Interactive Section */
.interactive-section {
    background: rgba(21, 21, 21, 0.7);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid rgba(230, 36, 41, 0.3);
}

.interactive-section h3 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 1.8rem;
    color: var(--christmas-gold);
    margin-bottom: 20px;
    text-align: center;
}

.interactive-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.control-btn {
    background: linear-gradient(135deg, var(--spider-red), #c11a1a);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(230, 36, 41, 0.4);
    background: linear-gradient(135deg, #ff2e2e, var(--spider-red));
}

.control-btn:active {
    transform: translateY(1px);
}

.christmas-countdown {
    background: rgba(26, 122, 26, 0.2);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.christmas-countdown h4 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 1.5rem;
    color: var(--christmas-gold);
    margin-bottom: 15px;
}

.countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.countdown-item {
    background: rgba(21, 21, 21, 0.8);
    padding: 15px 10px;
    border-radius: 10px;
    border: 2px solid var(--spider-blue);
}

.countdown-item span {
    display: block;
    font-family: 'Bangers', cursive;
    font-size: 2.2rem;
    color: var(--spider-red);
    text-shadow: 0 0 10px rgba(230, 36, 41, 0.5);
}

.countdown-item small {
    color: var(--snow-white);
    font-size: 0.9rem;
    display: block;
    margin-top: 5px;
}

/* Card Footer */
.card-footer {
    padding: 30px 40px;
    background: rgba(10, 26, 45, 0.5);
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.personal-note {
    margin-bottom: 30px;
    position: relative;
}

.personal-note p {
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: center;
    margin-bottom: 25px;
}

.personal-note i.fa-quote-left {
    color: var(--spider-red);
    font-size: 1.5rem;
    margin-right: 10px;
}

.personal-note i.fa-quote-right {
    color: var(--spider-red);
    font-size: 1.5rem;
    margin-left: 10px;
}

.signature-box {
    background: linear-gradient(135deg, 
                rgba(230, 36, 41, 0.1), 
                rgba(33, 99, 178, 0.1));
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    border: 2px solid transparent;
    border-image: linear-gradient(45deg, var(--spider-red), var(--christmas-gold)) 1;
}

.signature-box p {
    margin-bottom: 10px;
}

.highlight {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 1.8rem;
    color: var(--christmas-gold);
}

.highlight i {
    color: var(--spider-red);
    margin-left: 10px;
    animation: heartbeat 1.5s infinite;
}

.date {
    color: var(--spider-blue);
    font-style: italic;
    font-size: 1rem;
}

.social-sharing {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.share-btn {
    background: linear-gradient(135deg, var(--spider-blue), #1a4a8a);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(33, 99, 178, 0.4);
}

/* Music Player */
.music-player {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: rgba(21, 21, 21, 0.95);
    border-radius: 50px;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--spider-red);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-controls button {
    background: transparent;
    border: none;
    color: var(--christmas-gold);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.player-controls button:hover {
    background: rgba(230, 36, 41, 0.2);
    transform: scale(1.1);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

.volume-control i {
    color: var(--christmas-gold);
}

#volumeSlider {
    width: 80px;
    height: 5px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    outline: none;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--spider-red);
    cursor: pointer;
}

.track-info {
    flex-grow: 1;
    margin: 0 20px;
}

#currentTrack {
    display: block;
    font-size: 0.9rem;
    color: var(--snow-white);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--spider-red), var(--christmas-gold));
    width: 0%;
    transition: width 0.1s linear;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 30px 20px;
    position: relative;
    z-index: 5;
    background: rgba(10, 26, 45, 0.7);
    margin-top: 40px;
}

.main-footer p {
    margin-bottom: 10px;
    color: var(--snow-white);
}

.footer-note {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 15px 0;
}

.tech-stack {
    margin-top: 20px;
}

.tech-stack i {
    font-size: 1.5rem;
    margin: 0 10px;
    color: var(--spider-blue);
    transition: color 0.3s ease;
}

.tech-stack i:hover {
    color: var(--spider-red);
}

/* Confetti */
#confettiContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* Animations */
@keyframes webSwing {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(5deg); }
    75% { transform: translateX(-50%) rotate(-5deg); }
}

@keyframes spiderMove {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-20px); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes titleGlow {
    0% { text-shadow: 3px 3px 0 var(--spider-dark),
                     6px 6px 0 rgba(255, 215, 0, 0.3); }
    100% { text-shadow: 3px 3px 0 var(--spider-dark),
                     6px 6px 0 rgba(230, 36, 41, 0.5),
                     0 0 20px rgba(230, 36, 41, 0.5); }
}

@keyframes borderGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes spidermanSwing {
    0%, 100% { transform: rotate(-20deg) translateY(0); }
    50% { transform: rotate(-25deg) translateY(-20px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .card-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .title {
        font-size: 2.5rem;
    }
    
    .header-subtitle {
        font-size: 1.5rem;
    }
    
    .card-header h2 {
        font-size: 2rem;
    }
    
    .avatar-container {
        gap: 20px;
    }
    
    .avatar {
        width: 60px;
        height: 60px;
    }
    
    .wish-list {
        grid-template-columns: 1fr;
    }
    
    .countdown-item span {
        font-size: 1.8rem;
    }
    
    .music-player {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        border-radius: 20px;
        width: 95%;
    }
    
    .player-controls {
        order: 2;
    }
    
    .track-info {
        order: 1;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .greeting-card {
        margin: 0 10px;
    }
    
    .card-content,
    .card-header,
    .card-footer {
        padding: 20px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .share-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .interactive-controls {
        grid-template-columns: 1fr;
    }
}