/*
  Friendship Day Greeting for Friend ✨
  Feminine, magical, soft, and emotional theme
  All animations and colors are easily editable
*/
:root {
    --primary-color: #ff69b4;
    --secondary-color: #f8b4d9;
    --background-color: #fff9fc;
    --text-color: #2c1810;
    --card-background: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --flower-color: #ff85c8;
    --flower-center: #ffb6c1;
    --animation-timing: 0.6s;
}

.dark-mode {
    --primary-color: #ff85c8;
    --secondary-color: #b14e8f;
    --background-color: #1a1a2e;
    --text-color: #ffffff;
    --card-background: #2a2a4a;
    --card-shadow: rgba(255, 255, 255, 0.1);
}

/* General Styles */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.5s, color 0.5s;
    overflow-x: hidden;
}

/* Container styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Theme toggle styles */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

/* Music toggle styles */
.music-toggle {
    position: fixed;
    top: 20px;
    right: 80px;
    z-index: 1000;
}

#musicButton {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: transform 0.3s;
}

#musicButton:hover {
    transform: scale(1.1);
}

.music-on {
    display: none;
}

.playing .music-on {
    display: inline-block;
}

.playing .music-off {
    display: none;
}

#themeButton {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: transform 0.3s;
}

#themeButton:hover {
    transform: scale(1.1);
}

.dark-mode .sun {
    display: inline-block;
}

.dark-mode .moon {
    display: none;
}

.light-mode .sun {
    display: none;
}

.light-mode .moon {
    display: inline-block;
}

/* Title styles */
.title {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 1rem;
    font-family: 'Dancing Script', cursive;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px var(--card-shadow);
}

.subtitle {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    font-family: 'Dancing Script', cursive;
    color: var(--secondary-color);
}

/* Card styles */
.cards-container {
    display: flex;
    flex-direction: row;
    gap: 0.2rem;
    margin-top: 1rem;
    perspective: 1000px;
    justify-content: center;
    padding: 2rem;
}

.card {
    width: 400px;
    height: 200px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.card:nth-child(1) { transform: translateX(40px) translateZ(-20px); }
.card:nth-child(2) { transform: translateX(20px) translateZ(-40px); }
.card:nth-child(3) { transform: translateZ(-60px); }

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border-radius: 15px;
    background-color: var(--card-background);
    box-shadow: 0 4px 15px var(--card-shadow);
}

.card-back {
    transform: rotateY(180deg);
    text-align: center;
}

.card-front {
    transform: scale(1);
    transition: transform 0.3s ease;
}

.card:hover .card-front {
    transform: scale(1.05);
    box-shadow: 0 8px 25px var(--card-shadow);
}

.card-back p {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.card:hover .card-back p {
    opacity: 1;
    transform: translateY(0);
}

.card-design {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Center flower styles */
.center-flower {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    z-index: -1;
    animation: flowerAppear 1.2s 1.5s cubic-bezier(.4,0,.2,1) forwards;
}

.flower-center {
    width: 40px;
    height: 40px;
    background: var(--flower-center);
    border-radius: 50%;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 20px 5px var(--secondary-color);
}

.petals {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.petal {
    position: absolute;
    width: 30px;
    height: 60px;
    background: var(--flower-color);
    border-radius: 30px;
    transform-origin: center bottom;
    opacity: 0;
    animation: petalBloom 0.7s cubic-bezier(.4,0,.2,1) forwards;
}

.petal:nth-child(1) { transform: rotate(0deg) translateY(-30px); animation-delay: 1.7s; }
.petal:nth-child(2) { transform: rotate(45deg) translateY(-30px); animation-delay: 1.8s; }
.petal:nth-child(3) { transform: rotate(90deg) translateY(-30px); animation-delay: 1.9s; }
.petal:nth-child(4) { transform: rotate(135deg) translateY(-30px); animation-delay: 2.0s; }
.petal:nth-child(5) { transform: rotate(180deg) translateY(-30px); animation-delay: 2.1s; }
.petal:nth-child(6) { transform: rotate(225deg) translateY(-30px); animation-delay: 2.2s; }
.petal:nth-child(7) { transform: rotate(270deg) translateY(-30px); animation-delay: 2.3s; }
.petal:nth-child(8) { transform: rotate(315deg) translateY(-30px); animation-delay: 2.4s; }

/* Floating flowers background */
.floating-flowers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -2;
}

.float-flower {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--flower-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite linear;
}

.float-flower::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: var(--flower-color);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.8);
}

.float-flower:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.float-flower:nth-child(2) { top: 20%; left: 80%; animation-delay: -2s; }
.float-flower:nth-child(3) { top: 80%; left: 15%; animation-delay: -4s; }
.float-flower:nth-child(4) { top: 70%; left: 70%; animation-delay: -6s; }
.float-flower:nth-child(5) { top: 40%; left: 40%; animation-delay: -8s; }
.float-flower:nth-child(6) { top: 60%; left: 30%; animation-delay: -10s; }

/* Page unfold animation */
.page-unfold {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    z-index: 1000;
    animation: unfold 1.5s ease-in-out forwards;
    transform-origin: top;
}

/* Animations */
@keyframes unfold {
    0% {
        transform: scaleY(1);
    }
    100% {
        transform: scaleY(0);
    }
}

@keyframes flowerAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes petalBloom {
    0% {
        opacity: 0;
        transform-origin: bottom center;
        transform: rotate(var(--rotation)) translateY(-30px) scale(0);
    }
    100% {
        opacity: 1;
        transform-origin: bottom center;
        transform: rotate(var(--rotation)) translateY(-30px) scale(1);
    }
}

@keyframes float {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(30px, -50px) rotate(120deg);
    }
    66% {
        transform: translate(-30px, -100px) rotate(240deg);
    }
    100% {
        transform: translate(0, -150px) rotate(360deg);
    }
}

/* Make content initially hidden and fade in */
.hidden {
    opacity: 0;
    transform: translateY(20px);
    animation: fade-in 1s ease-out 1.5s forwards;
}

@keyframes fade-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Particle styles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: particleFloat 10s var(--delay) infinite linear;
    width: var(--size);
    height: var(--size);
}

@keyframes particleFloat {
    0% {
        transform: translate(var(--start-x), 100vh) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translate(var(--end-x), -100px) rotate(360deg);
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 1024px) {
    .cards-container {
        transform: scale(0.9);
        flex-wrap: wrap;
    }
    
    .card {
        width: 350px;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.5rem;
    }
    
    .cards-container {
        transform: scale(0.85);
        padding: 1rem;
    }
    
    .card:nth-child(1) { transform: translateX(20px) translateZ(-20px); }
    .card:nth-child(2) { transform: translateX(10px) translateZ(-40px); }
    .card:nth-child(3) { transform: translateZ(-60px); }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .cards-container {
        flex-direction: column;
        transform: scale(0.8);
        padding: 0.5rem;
    }
    
    .card {
        width: 300px;
    }
    
    .card:nth-child(1) { transform: translateY(-20px) translateZ(-20px); }
    .card:nth-child(2) { transform: translateY(-10px) translateZ(-40px); }
    .card:nth-child(3) { transform: translateZ(-60px); }
}
