/* ============================================
   CHRISTMAS CARD - BASE STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.5s ease;
}

/* ============================================
   THEME VARIABLES
   ============================================ */

/* Theme 1: Classic Red & Gold */
body.theme-1 {
    background: linear-gradient(135deg, #1a0a0a 0%, #2d0f0f 50%, #1a0a0a 100%);
}
.theme-1 .card-front {
    background: linear-gradient(145deg, #b22222 0%, #8b0000 100%);
}
.theme-1 .card-inside {
    background: linear-gradient(145deg, #fff8e7 0%, #fff5d4 100%);
}
.theme-1 .merry, .theme-1 .christmas {
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.theme-1 .card-decoration {
    border-color: #ffd700;
}

/* Theme 2: Winter Wonderland Blue */
body.theme-2 {
    background: linear-gradient(135deg, #0c1445 0%, #1a237e 50%, #0c1445 100%);
}
.theme-2 .card-front {
    background: linear-gradient(145deg, #1565c0 0%, #0d47a1 100%);
}
.theme-2 .card-inside {
    background: linear-gradient(145deg, #e3f2fd 0%, #bbdefb 100%);
}
.theme-2 .merry, .theme-2 .christmas {
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
}
.theme-2 .card-decoration {
    border-color: #90caf9;
}

/* Theme 3: Elegant Green */
body.theme-3 {
    background: linear-gradient(135deg, #0a1f0a 0%, #1b3d1b 50%, #0a1f0a 100%);
}
.theme-3 .card-front {
    background: linear-gradient(145deg, #2e7d32 0%, #1b5e20 100%);
}
.theme-3 .card-inside {
    background: linear-gradient(145deg, #f1f8e9 0%, #dcedc8 100%);
}
.theme-3 .merry, .theme-3 .christmas {
    color: #ffeb3b;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.theme-3 .card-decoration {
    border-color: #aed581;
}

/* Theme 4: Purple Magic */
body.theme-4 {
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 50%, #1a0a2e 100%);
}
.theme-4 .card-front {
    background: linear-gradient(145deg, #7b1fa2 0%, #4a148c 100%);
}
.theme-4 .card-inside {
    background: linear-gradient(145deg, #f3e5f5 0%, #e1bee7 100%);
}
.theme-4 .merry, .theme-4 .christmas {
    color: #ffcc80;
    text-shadow: 0 0 15px rgba(255,204,128,0.5);
}
.theme-4 .card-decoration {
    border-color: #ce93d8;
}

/* Theme 5: Snowy Night */
body.theme-5 {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}
.theme-5 .card-front {
    background: linear-gradient(145deg, #37474f 0%, #263238 100%);
}
.theme-5 .card-inside {
    background: linear-gradient(145deg, #eceff1 0%, #cfd8dc 100%);
}
.theme-5 .merry, .theme-5 .christmas {
    color: #80deea;
    text-shadow: 0 0 20px rgba(128,222,234,0.6);
}
.theme-5 .card-decoration {
    border-color: #4dd0e1;
}

/* ============================================
   SNOWFALL
   ============================================ */

.snowfall {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: #fff;
    font-size: 1em;
    text-shadow: 0 0 5px rgba(255,255,255,0.8);
    animation: fall linear infinite;
    opacity: 0.8;
}

@keyframes fall {
    0% {
        transform: translateY(-10px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0.3;
    }
}

/* ============================================
   LANDING PAGE
   ============================================ */

.landing-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: inherit;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.landing-page.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

.landing-content {
    text-align: center;
    padding: 20px;
    animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.christmas-tree {
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.star {
    font-size: 3rem;
    color: #ffd700;
    text-shadow: 0 0 20px #ffd700, 0 0 40px #ffd700;
    animation: twinkle 1s ease-in-out infinite alternate;
}

@keyframes twinkle {
    from { opacity: 0.7; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1.1); }
}

.tree {
    width: 0;
    height: 0;
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 100px solid #228b22;
    margin: 0 auto;
    position: relative;
    filter: drop-shadow(0 0 10px rgba(34,139,34,0.5));
}

.tree::after {
    content: '';
    position: absolute;
    bottom: -120px;
    left: -30px;
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 60px solid #8b4513;
}

.landing-title {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    color: #fff;
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255,255,255,0.5); }
    to { text-shadow: 0 0 30px rgba(255,255,255,0.8), 0 0 40px rgba(255,215,0,0.5); }
}

.landing-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: #ffd700;
    margin-bottom: 40px;
}

/* Present Button */
.present-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: linear-gradient(145deg, #c41e3a 0%, #8b0000 100%);
    color: #fff;
    border: none;
    padding: 20px 30px;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(196, 30, 58, 0.4),
                inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    animation: pulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.present-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(196, 30, 58, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(196, 30, 58, 0.6);
    }
}

.present-button:hover {
    transform: scale(1.08);
    box-shadow: 0 15px 40px rgba(196, 30, 58, 0.6);
}

.present-button:active {
    transform: scale(0.98);
}

.button-icon {
    font-size: 2rem;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.button-text {
    line-height: 1.4;
}

.ornaments {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.ornament {
    font-size: 2rem;
    animation: swing 2s ease-in-out infinite;
}

.ornament:nth-child(2) { animation-delay: 0.2s; }
.ornament:nth-child(3) { animation-delay: 0.4s; }
.ornament:nth-child(4) { animation-delay: 0.6s; }
.ornament:nth-child(5) { animation-delay: 0.8s; }

@keyframes swing {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

/* ============================================
   CARD CONTAINER
   ============================================ */

.card-container {
    perspective: 2000px;
    width: 90%;
    max-width: 500px;
    height: 80vh;
    max-height: 700px;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.card-container.visible {
    display: block;
    opacity: 1;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
}

.card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Show/hide faces */
.card-front {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.card-inside {
    opacity: 0;
    visibility: hidden;
    z-index: 1;
}

.card.flipped .card-front {
    opacity: 0;
    visibility: hidden;
    z-index: 1;
}

.card.flipped .card-inside {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

/* ============================================
   CARD FRONT (COVER)
   ============================================ */

.card-front {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    position: relative;
}

.card-decoration {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid;
    opacity: 0.5;
}

.card-decoration.top-left {
    top: 15px;
    left: 15px;
    border-right: none;
    border-bottom: none;
    border-radius: 10px 0 0 0;
}

.card-decoration.top-right {
    top: 15px;
    right: 15px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 10px 0 0;
}

.card-decoration.bottom-left {
    bottom: 15px;
    left: 15px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 10px;
}

.card-decoration.bottom-right {
    bottom: 15px;
    right: 15px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 10px 0;
}

.front-content {
    text-align: center;
    z-index: 1;
}

.greeting-text {
    margin-bottom: 30px;
}

.merry {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    margin-bottom: -20px;
}

.christmas {
    font-family: 'Great Vibes', cursive;
    font-size: 4.5rem;
}

.divider {
    margin: 20px 0;
}

.divider-ornament {
    font-size: 1.5rem;
    animation: spin 4s linear infinite;
    display: inline-block;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.new-year {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: rgba(255,255,255,0.9);
}

.year {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255,215,0,0.5);
    margin-top: 10px;
}

.front-decoration .wreath {
    font-size: 5rem;
    animation: float 3s ease-in-out infinite;
}

.tap-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    animation: fadeInOut 2s ease-in-out infinite;
}

.card-inside .tap-hint {
    color: rgba(0,0,0,0.5);
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.auto-open-timer {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.3);
    padding: 8px 20px;
    border-radius: 20px;
    color: #fff;
    font-size: 0.85rem;
}

/* ============================================
   CARD INSIDE
   ============================================ */

.card-inside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    position: relative;
    background: linear-gradient(145deg, #fffef5 0%, #fff8e7 100%);
}

.inside-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.lights-string {
    display: flex;
    justify-content: space-around;
    padding: 15px;
}

.light {
    width: 15px;
    height: 20px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: lightGlow 1s ease-in-out infinite alternate;
}

.light:nth-child(1) { background: #ff0000; animation-delay: 0s; }
.light:nth-child(2) { background: #00ff00; animation-delay: 0.1s; }
.light:nth-child(3) { background: #ffff00; animation-delay: 0.2s; }
.light:nth-child(4) { background: #0000ff; animation-delay: 0.3s; }
.light:nth-child(5) { background: #ff00ff; animation-delay: 0.4s; }
.light:nth-child(6) { background: #00ffff; animation-delay: 0.5s; }
.light:nth-child(7) { background: #ff8800; animation-delay: 0.6s; }

@keyframes lightGlow {
    from {
        box-shadow: 0 0 5px currentColor, 0 0 10px currentColor;
        opacity: 0.7;
    }
    to {
        box-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
        opacity: 1;
    }
}

.inside-content {
    text-align: center;
    max-width: 90%;
    z-index: 1;
    position: relative;
}

.message-container {
    position: relative;
    margin-bottom: 30px;
    padding: 20px;
}

.quote-mark {
    font-family: 'Great Vibes', cursive;
    font-size: 4rem;
    color: rgba(139,0,0,0.2);
    position: absolute;
    top: -10px;
    left: 0;
}

.quote-mark.bottom {
    top: auto;
    bottom: -30px;
    right: 0;
    left: auto;
}

.message {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    line-height: 1.8;
    color: #2c2c2c;
}

.signature {
    margin-top: 20px;
}

.from-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #666;
    margin-bottom: 5px;
}

.from-name {
    font-family: 'Great Vibes', cursive;
    font-size: 2.5rem;
    color: #8b0000;
}

.signature-decoration {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
    font-size: 1.5rem;
}

/* Confetti */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .landing-title {
        font-size: 3rem;
    }

    .landing-subtitle {
        font-size: 1.2rem;
    }

    .present-button {
        padding: 15px 20px;
        font-size: 0.95rem;
        flex-direction: column;
        gap: 10px;
    }

    .button-icon {
        font-size: 1.5rem;
    }

    .button-text {
        font-size: 0.9rem;
    }

    .merry {
        font-size: 3rem;
    }

    .christmas {
        font-size: 3.5rem;
    }

    .new-year {
        font-size: 1.4rem;
    }

    .year {
        font-size: 2.5rem;
    }

    .message {
        font-size: 1.2rem;
    }

    .from-name {
        font-size: 2rem;
    }

    .card-container {
        width: 95%;
        height: 85vh;
    }
}

@media (max-width: 480px) {
    .landing-title {
        font-size: 2.5rem;
    }

    .landing-subtitle {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .tree {
        border-left: 35px solid transparent;
        border-right: 35px solid transparent;
        border-bottom: 70px solid #228b22;
    }

    .star {
        font-size: 2rem;
    }

    .present-button {
        padding: 15px;
        width: 90%;
    }

    .ornaments {
        gap: 10px;
    }

    .ornament {
        font-size: 1.5rem;
    }

    .merry {
        font-size: 2.5rem;
        margin-bottom: -15px;
    }

    .christmas {
        font-size: 2.8rem;
    }

    .new-year {
        font-size: 1.2rem;
    }

    .year {
        font-size: 2rem;
    }

    .front-decoration .wreath {
        font-size: 3.5rem;
    }

    .card-decoration {
        width: 40px;
        height: 40px;
    }

    .message {
        font-size: 1rem;
        line-height: 1.6;
    }

    .quote-mark {
        font-size: 3rem;
    }

    .from-name {
        font-size: 1.8rem;
    }

    .lights-string {
        padding: 10px;
    }

    .light {
        width: 10px;
        height: 15px;
    }
}

@media (max-height: 600px) {
    .card-container {
        height: 90vh;
    }

    .christmas-tree {
        display: none;
    }

    .landing-title {
        font-size: 2.5rem;
        margin-bottom: 5px;
    }

    .landing-subtitle {
        margin-bottom: 20px;
    }

    .ornaments {
        margin-top: 20px;
    }
}

/* Landscape mode for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .landing-content {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 20px;
    }

    .christmas-tree {
        display: none;
    }

    .landing-title,
    .landing-subtitle {
        width: 100%;
    }

    .card-container {
        max-width: 400px;
        height: 95vh;
    }
}
