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

body {
    font-family: 'KaiTi', 'STKaiti', 'Georgia', serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #ffeef8 0%, #f5e6fa 25%, #e8f5ff 50%, #fff5e6 75%, #f0fff4 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
}

/* Watercolor Texture Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(173, 216, 230, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 218, 185, 0.2) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Gradient Animation */
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Hidden Class */
.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ==================== Cover Page Styles ==================== */
.cover-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 1s ease, visibility 1s ease;
}

.cover-content {
    text-align: center;
    position: relative;
    padding: 40px;
    animation: fadeInUp 1.5s ease-out;
}

/* Decorative Elements */
.decorative-element {
    position: absolute;
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
}

.flower-1 {
    top: -30px;
    left: 20%;
    animation-delay: 0s;
}

.flower-2 {
    top: -20px;
    right: 15%;
    animation-delay: 0.5s;
}

.heart-1 {
    bottom: 100px;
    left: 10%;
    animation-delay: 1s;
}

.heart-2 {
    bottom: 120px;
    right: 10%;
    animation-delay: 1.5s;
}

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

/* Cover Title */
.cover-title {
    font-family: 'Zhi Mang Xing', 'Ma Shan Zheng', 'KaiTi', cursive;
    font-size: 5rem;
    color: #d4527a;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(212, 82, 122, 0.3),
                 3px 3px 6px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 1.5s ease-out 0.3s both;
}

.cover-subtitle {
    font-family: 'Georgia', serif;
    font-size: 1.8rem;
    color: #8b6f9e;
    margin-bottom: 15px;
    font-style: italic;
    letter-spacing: 3px;
    animation: fadeInUp 1.5s ease-out 0.5s both;
}

.cover-date {
    font-size: 1.3rem;
    color: #9a8b7a;
    margin-bottom: 40px;
    animation: fadeInUp 1.5s ease-out 0.7s both;
}

/* Start Button */
.start-button {
    font-family: 'Ma Shan Zheng', 'KaiTi', cursive;
    font-size: 1.8rem;
    padding: 15px 50px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    border: 3px solid #fff;
    border-radius: 50px;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 154, 158, 0.4),
                0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1.5s ease-out 0.9s both;
}

.start-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
}

.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 154, 158, 0.5),
                0 6px 15px rgba(0, 0, 0, 0.15);
}

.start-button:hover::before {
    left: 100%;
}

.start-button:active {
    transform: translateY(0);
}

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-icon {
    margin-left: 10px;
    position: relative;
    z-index: 1;
}

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

/* ==================== Album Page Styles ==================== */
.album-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 1s ease, visibility 1s ease;
}

.album-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Photo Wrapper */
.photo-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 30px;
}

/* Photo Page */
.photo-page {
    position: relative;
    width: 100%;
    max-width: 700px;
    height: 50vh;
    min-height: 400px;
    perspective: 1000px;
}

.photo-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2),
                0 5px 15px rgba(0, 0, 0, 0.1);
    transform: rotate(-2deg);
    transition: transform 0.5s ease;
}

.photo-inner:hover {
    transform: rotate(0deg);
}

/* Photo Image */
.photo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 8px solid #fff;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    transition: opacity 0.5s ease;
}

/* Tape Effect */
.tape {
    position: absolute;
    width: 80px;
    height: 30px;
    background: linear-gradient(135deg, rgba(255, 235, 180, 0.85) 0%, rgba(255, 220, 150, 0.85) 100%);
    opacity: 0.8;
    z-index: 10;
}

.tape::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.1) 2px,
        rgba(255, 255, 255, 0.1) 4px
    );
}

.tape-top-left {
    top: -12px;
    left: 30px;
    transform: rotate(-45deg);
}

.tape-top-right {
    top: -12px;
    right: 30px;
    transform: rotate(45deg);
}

.tape-bottom-left {
    bottom: -12px;
    left: 30px;
    transform: rotate(45deg);
}

.tape-bottom-right {
    bottom: -12px;
    right: 30px;
    transform: rotate(-45deg);
}

/* Photo Caption */
.photo-caption {
    width: 100%;
    max-width: 600px;
}

.caption-inner {
    background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%);
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    transform: rotate(1deg);
    transition: transform 0.3s ease;
}

.caption-inner::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 20px;
    background: linear-gradient(135deg, rgba(255, 235, 180, 0.9) 0%, rgba(255, 220, 150, 0.9) 100%);
    border-radius: 3px;
}

.caption-inner:hover {
    transform: rotate(0deg);
}

.caption-description {
    font-family: 'Ma Shan Zheng', 'KaiTi', cursive;
    font-size: 1.5rem;
    color: #5a5a5a;
    line-height: 2;
    text-align: center;
}

/* Controls */
.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.control-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 154, 158, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 154, 158, 0.5);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Progress Dots */
.progress-container {
    margin-top: 10px;
}

.progress-dots {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid #d4527a;
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-dot.active {
    background: #d4527a;
    transform: scale(1.3);
}

.progress-dot:hover {
    transform: scale(1.2);
}

/* Back to Cover Button */
.back-cover-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 154, 158, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-cover-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(255, 154, 158, 0.5);
}

/* Photo Transition Animation */
.photo-page.transitioning .photo-image {
    opacity: 0;
    transform: scale(0.95);
}

.photo-page.transitioning-in .photo-image {
    animation: photoFadeIn 0.5s ease forwards;
}

@keyframes photoFadeIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .cover-title {
        font-size: 3rem;
    }

    .cover-subtitle {
        font-size: 1.3rem;
    }

    .cover-date {
        font-size: 1rem;
    }

    .start-button {
        font-size: 1.4rem;
        padding: 12px 35px;
    }

    .decorative-element {
        font-size: 1.5rem;
    }

    .album-container {
        width: 95%;
        height: 95vh;
        padding: 10px;
    }

    .photo-page {
        max-width: 100%;
    }

    .caption-inner {
        padding: 15px 20px;
    }

    .caption-description {
        font-size: 1.2rem;
    }

    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .progress-dot {
        width: 10px;
        height: 10px;
    }

    .tape {
        width: 50px;
        height: 20px;
    }

    .tape-top-left,
    .tape-top-right {
        top: -8px;
    }

    .tape-bottom-left,
    .tape-bottom-right {
        bottom: -8px;
    }
}

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

    .cover-subtitle {
        font-size: 1.1rem;
    }

    .cover-content {
        padding: 20px;
    }

    .photo-wrapper {
        gap: 20px;
    }

    .controls {
        gap: 15px;
    }

    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

/* ==================== Loading State ==================== */
.photo-image.loading {
    opacity: 0.5;
    filter: blur(5px);
}
