/* ========================================
   Root Variables & Reset
   ======================================== */
:root {
    --primary-color: #ff6b9d;
    --secondary-color: #c44569;
    --accent-color: #ffd93d;
    --bg-gradient-1: #1a1a2e;
    --bg-gradient-2: #16213e;
    --bg-gradient-3: #0f3460;
    --text-color: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
}

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

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'ZCOOL XiaoWei', serif;
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2), var(--bg-gradient-3));
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   Swiper Base Styles
   ======================================== */
.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.swiper-pagination {
    bottom: 20px !important;
}

.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    width: 10px;
    height: 10px;
    opacity: 1;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background: var(--primary-color);
    width: 30px;
    border-radius: 5px;
}

/* ========================================
   Content Container
   ======================================== */
.content {
    max-width: 100%;
    width: 100%;
    padding: 20px;
    text-align: center;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

/* ========================================
   Slide 1: Opening
   ======================================== */
.slide-1 {
    background: linear-gradient(180deg,
        #1a1a2e 0%,
        #2d1b4e 50%,
        #1a1a2e 100%);
}

.slide-1::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="white" opacity="0.3"/></svg>');
    background-size: 50px 50px;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.title-container {
    margin-bottom: 30px;
}

.main-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color), var(--primary-color));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite, float 3s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 107, 157, 0.5);
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 10px;
    opacity: 0;
    animation: fade-in 1s ease forwards 0.5s;
}

@keyframes fade-in {
    to { opacity: 1; }
}

.scroll-hint {
    position: absolute;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: bounce 2s ease-in-out infinite;
}

.scroll-hint span {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    transform: rotate(-135deg);
}

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

/* ========================================
   Image Placeholders
   ======================================== */
.image-placeholder {
    width: 200px;
    height: 200px;
    border: 2px solid var(--glass-border);
    border-radius: 20px;
    margin: 20px auto;
    transition: all 0.3s ease;
    object-fit: cover;
    display: block;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.image-placeholder:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 30px rgba(255, 107, 157, 0.5), 0 8px 40px rgba(0, 0, 0, 0.4);
    transform: scale(1.05);
}

.image-placeholder.large {
    width: 280px;
    height: 280px;
}

.image-placeholder.medium {
    width: 240px;
    height: 180px;
}

.image-placeholder.portrait {
    width: 180px;
    height: 240px;
}

.image-placeholder.small {
    width: 100px;
    height: 100px;
}

/* ========================================
   Slide 2 & 3: Past & Present
   ======================================== */
.slide-2 {
    background: linear-gradient(180deg,
        #2d1b4e 0%,
        #4a2c7a 50%,
        #2d1b4e 100%);
}

.slide-3 {
    background: linear-gradient(180deg,
        #1e3c72 0%,
        #2a5298 50%,
        #1e3c72 100%);
}

.chapter-badge {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
    animation: pulse-badge 3s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 25px rgba(255, 107, 157, 0.6);
        transform: scale(1.02);
    }
}

.chapter-badge.special {
    background: linear-gradient(135deg, var(--accent-color), #ff9a3c);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 15px rgba(255, 211, 61, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(255, 211, 61, 0.8); }
}

.chapter-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.chapter-title.glow {
    text-shadow: 0 0 20px var(--accent-color), 0 0 40px var(--accent-color);
}

.chapter-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    font-style: italic;
}

.story-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 25px;
    padding: 25px;
    max-width: 350px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    border-color: var(--glass-border);
}

.story-card.glass {
    background: rgba(255, 255, 255, 0.05);
}

@keyframes slide-up {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.story-text {
    margin-top: 20px;
}

.story-text p {
    margin: 10px 0;
    font-size: 1.1rem;
    line-height: 1.6;
}

.story-text .highlight {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2rem;
    animation: text-glow 2s ease-in-out infinite;
}

@keyframes text-glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 107, 157, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 107, 157, 0.6), 0 0 30px rgba(255, 107, 157, 0.4);
    }
}

/* Floating Hearts */
.floating-hearts {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-hearts::before,
.floating-hearts::after {
    content: '❤';
    position: absolute;
    font-size: 20px;
    color: var(--primary-color);
    opacity: 0.3;
    animation: float-heart 6s ease-in-out infinite;
}

.floating-hearts::before {
    left: 10%;
    animation-delay: 0s;
}

.floating-hearts::after {
    right: 10%;
    animation-delay: 3s;
}

@keyframes float-heart {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ========================================
   Slide 4: Future Grid
   ======================================== */
.slide-4 {
    background: linear-gradient(180deg,
        #0f3460 0%,
        #533483 50%,
        #0f3460 100%);
}

.future-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 350px;
    margin-top: 20px;
}

.future-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.future-card:hover {
    transform: scale(1.05) translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 15px 40px rgba(255, 107, 157, 0.4);
}

.future-card:hover .image-placeholder {
    transform: scale(1.05);
}

.future-card p {
    margin-top: 10px;
    font-size: 0.95rem;
}

/* ========================================
   Slide 5: Promises
   ======================================== */
.slide-5 {
    background: linear-gradient(180deg,
        #533483 0%,
        #e94560 50%,
        #533483 100%);
}

.promise-container {
    width: 100%;
    max-width: 350px;
}

.promise-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.promise-list {
    margin-bottom: 20px;
}

.promise-item {
    display: flex;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 12px 20px;
    margin: 10px 0;
    transition: all 0.3s ease;
    cursor: default;
}

.promise-item:hover {
    background: rgba(255, 107, 157, 0.15);
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.2);
}

@keyframes slide-right {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.promise-icon {
    font-size: 1.5rem;
    margin-right: 15px;
}

.promise-item p {
    font-size: 1rem;
}

/* ========================================
   Slide 6: The Question
   ======================================== */
.slide-6 {
    background: linear-gradient(180deg,
        #e94560 0%,
        #ff6b9d 30%,
        #ffd93d 70%,
        #e94560 100%);
    background-size: 100% 200%;
    animation: gradient-bg 5s ease infinite;
}

@keyframes gradient-bg {
    0%, 100% { background-position: 0% 0%; }
    50% { background-position: 0% 100%; }
}

.question-page {
    position: relative;
}

.question-container {
    transition: all 0.5s ease;
}

.question-container.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.heart-decoration {
    font-size: 4rem;
    color: #fff;
    animation: heartbeat 1s ease-in-out infinite;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
}

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

.question-text {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2rem;
    margin: 20px 0 10px;
}

.question-main {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 40px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.button-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.btn {
    padding: 15px 50px;
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-yes {
    background: linear-gradient(135deg, #fff, #ffe6ec);
    color: var(--secondary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: btn-pulse 2s ease-in-out infinite;
}

@keyframes btn-pulse {
    0%, 100% {
        box-shadow: 0 10px 30px rgba(255, 107, 157, 0.3);
    }
    50% {
        box-shadow: 0 15px 40px rgba(255, 107, 157, 0.5), 0 0 30px rgba(255, 107, 157, 0.3);
    }
}

.btn-yes:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 40px rgba(255, 107, 157, 0.6);
    animation: btn-pulse 1s ease-in-out infinite;
}

.btn-yes .btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: rotate(45deg);
    animation: btn-shine 2s ease-in-out infinite;
}

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

.btn-no {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
    padding: 10px 30px;
}

.btn-no:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-no.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.btn-no.error {
    border-color: transparent;
    color: rgba(255, 255, 255, 0.3);
}

/* Success Container */
.success-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: all 0.5s ease;
    text-align: center;
    width: 90%;
}

.success-container.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.success-title {
    font-size: 5rem;
    animation: heartbeat 1s ease-in-out infinite;
}

.success-text {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3rem;
    margin: 20px 0;
}

.success-message {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.celebration-emoji {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 3rem;
    margin-top: 20px;
}

.celebration-emoji span {
    animation: bounce-emoji 1s ease-in-out infinite;
}

.celebration-emoji span:nth-child(1) { animation-delay: 0s; }
.celebration-emoji span:nth-child(2) { animation-delay: 0.1s; }
.celebration-emoji span:nth-child(3) { animation-delay: 0.2s; }
.celebration-emoji span:nth-child(4) { animation-delay: 0.3s; }
.celebration-emoji span:nth-child(5) { animation-delay: 0.4s; }

@keyframes bounce-emoji {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-15px) scale(1.2); }
}

/* Fireworks Canvas */
#fireworksCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* ========================================
   Music Button
   ======================================== */
.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.music-btn.playing .music-icon {
    animation: music-pulse 0.5s ease infinite;
}

@keyframes music-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 380px) {
    .main-title {
        font-size: 2.8rem;
    }

    .chapter-title {
        font-size: 2rem;
    }

    .question-main {
        font-size: 1.5rem;
    }

    .image-placeholder.large {
        width: 240px;
        height: 240px;
    }

    .future-grid {
        gap: 10px;
    }

    .future-card {
        padding: 10px;
    }

    .image-placeholder.small {
        width: 80px;
        height: 80px;
    }
}

@media (min-width: 768px) {
    .main-title {
        font-size: 4.5rem;
    }

    .chapter-title {
        font-size: 3rem;
    }

    .story-card {
        max-width: 500px;
        padding: 40px;
    }

    .future-grid {
        max-width: 500px;
        gap: 20px;
    }

    .promise-container {
        max-width: 500px;
    }
}

/* ========================================
   Additional Animations
   ======================================== */
.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-fade-in {
    animation: fade-in 1s ease forwards;
}

/* Slide-in animations for all elements */
/* First slide animations */
.slide-1.swiper-slide-active .title-container {
    animation: slide-down 0.8s ease forwards;
    opacity: 0;
}

.slide-1.swiper-slide-active .image-placeholder {
    animation: zoom-in 1s ease forwards 0.8s, float-gentle 3s ease-in-out infinite 1.8s;
    opacity: 0;
}

.slide-1.swiper-slide-active .scroll-hint {
    animation: fade-in 1s ease forwards 1.2s, bounce 2s ease-in-out infinite 2.2s;
    opacity: 0;
}

/* Other slides */
.swiper-slide-active .chapter-badge {
    animation: slide-down 0.6s ease forwards;
}

.swiper-slide-active .chapter-title {
    animation: slide-up 0.8s ease forwards 0.2s;
    opacity: 0;
}

.swiper-slide-active .chapter-subtitle {
    animation: fade-in 0.8s ease forwards 0.4s;
    opacity: 0;
}

.swiper-slide-active .story-card {
    animation: slide-up 0.8s ease forwards 0.6s;
    opacity: 0;
}

.swiper-slide-active .image-placeholder {
    animation: zoom-in 0.8s ease forwards 0.6s, float-gentle 3s ease-in-out infinite 1.4s;
    opacity: 0;
}

.swiper-slide-active .story-text p {
    animation: slide-right 0.8s ease forwards;
    opacity: 0;
}

.swiper-slide-active .story-text p:nth-child(1) { animation-delay: 0.8s; }
.swiper-slide-active .story-text p:nth-child(2) { animation-delay: 1s; }
.swiper-slide-active .story-text p:nth-child(3) { animation-delay: 1.2s; }

.swiper-slide-active .future-card {
    animation: scale-in 0.6s ease forwards;
    opacity: 0;
}

.swiper-slide-active .future-card:nth-child(1) { animation-delay: 0.8s; }
.swiper-slide-active .future-card:nth-child(2) { animation-delay: 1s; }

.swiper-slide-active .future-card p {
    animation: fade-in 0.6s ease forwards;
    opacity: 0;
}

.swiper-slide-active .future-card:nth-child(1) p { animation-delay: 1s; }
.swiper-slide-active .future-card:nth-child(2) p { animation-delay: 1.2s; }

.swiper-slide-active .promise-title {
    animation: slide-down 0.8s ease forwards 0.6s;
    opacity: 0;
}

.swiper-slide-active .promise-item {
    animation: slide-right 0.5s ease forwards;
    transform: translateX(-50px);
    opacity: 0;
}

.swiper-slide-active .promise-item:nth-child(1) { animation-delay: 0.8s; }
.swiper-slide-active .promise-item:nth-child(2) { animation-delay: 0.9s; }
.swiper-slide-active .promise-item:nth-child(3) { animation-delay: 1.0s; }
.swiper-slide-active .promise-item:nth-child(4) { animation-delay: 1.1s; }
.swiper-slide-active .promise-item:nth-child(5) { animation-delay: 1.2s; }

.swiper-slide-active .promise-container > .image-placeholder {
    animation: zoom-in 0.8s ease forwards 1.4s, float-gentle 3s ease-in-out infinite 2.2s;
    opacity: 0;
}

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

@keyframes zoom-in {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scale-in {
    from {
        transform: scale(0.5) rotate(-5deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.02); }
}

/* Question page animations */
.swiper-slide-active .heart-decoration {
    animation: heartbeat 1s ease-in-out infinite, rotate-in 0.8s ease forwards;
    opacity: 0;
}

@keyframes rotate-in {
    from {
        transform: rotate(-180deg) scale(0);
        opacity: 0;
    }
    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

.swiper-slide-active .question-text {
    animation: slide-up 0.8s ease forwards 0.3s;
    opacity: 0;
}

.swiper-slide-active .question-main {
    animation: slide-up 0.8s ease forwards 0.5s;
    opacity: 0;
}

.swiper-slide-active .button-container {
    animation: slide-up 0.8s ease forwards 0.7s;
    opacity: 0;
}

/* Particle effect for background */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

/* Custom scrollbar (for webkit browsers) */
::-webkit-scrollbar {
    display: none;
}

/* Selection color */
::selection {
    background: var(--primary-color);
    color: #fff;
}
