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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

.book-container {
    margin-bottom: 30px;
    perspective: 2000px;
    transition: all 0.5s ease;
    position: relative;
}

/* A4 Ratio: 210mm x 297mm = 1:1.414 */
/* Double width for two-page spread */
#flipbook {
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
    transition: width 0.3s ease, height 0.3s ease;
    max-width: 95vw;
    max-height: 85vh;
}

#flipbook .magazine-page {
    background: white;
    overflow: hidden;
    position: relative;
    background-image: url('images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Add overlay to all pages except cover */
.magazine-page:not(.cover-page)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 1;
}

.magazine-page:not(.cover-page) .page-content {
    position: relative;
    z-index: 2;
}

.magazine-page {
    background: white;
    overflow: hidden;
    position: relative;
}

.page-content {
    width: 100%;
    height: 100%;
    padding: 5%;
    position: relative;
    overflow: hidden;
}

.page-number {
    position: absolute;
    bottom: 3%;
    right: 5%;
    font-size: 0.9em;
    color: #999;
    font-style: italic;
}

/* Cover Page */
.cover-page {
    position: relative;
    background-image: url('images/cover.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #333;
}

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1;
}

.cover-page .page-content {
    background: transparent;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    position: relative;
    z-index: 2;
    padding: 6%;
    overflow: hidden;
}

.cover-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-family: 'Times New Roman', Times, serif;
    font-size: clamp(0.8em, 1.2vw, 1em);
    letter-spacing: 1px;
    margin-bottom: 10%;
}

.cover-date {
    text-transform: uppercase;
}

.cover-volume {
    font-style: italic;
}

.cover-title {
    font-family: 'Times New Roman', Times, serif;
    font-size: clamp(5em, 4vw, 6em);
    font-weight: bold;
    letter-spacing: 6px;
    line-height: 1;
    margin: 0;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.5);
    margin-bottom: auto;
}

.cover-footer {
    margin-top: auto;
}

.cover-subtitle {
    font-family: 'Times New Roman', Times, serif;
    font-size: clamp(1.5em, 2.8vw, 2.5em);
    font-weight: normal;
    line-height: 1.2;
    text-align: left;
    letter-spacing: 2px;
}

.cover-subtitle div {
    margin-bottom: 0.1em;
}

/* Typography */
h2 {
    font-size: clamp(1.5em, 3vw, 2.5em);
    color: #c86dd7;
    margin-bottom: 5%;
    font-family: 'Palatino', 'Times New Roman', serif;
    line-height: 1.2;
}

.section-title {
    font-size: clamp(1.8em, 3.5vw, 3em);
    line-height: 1.1;
    margin-bottom: 6%;
}

.love-letter {
    font-size: clamp(1em, 1.5vw, 1.15em);
    line-height: 1.9;
    color: #333;
    margin-bottom: 4%;
    text-align: justify;
}

.signature {
    margin-top: 8%;
    font-style: italic;
    text-align: right;
    color: #c86dd7;
    font-size: clamp(1em, 1.5vw, 1.2em);
    line-height: 1.6;
}

/* Decorative Elements */
.decorative-hearts {
    display: flex;
    justify-content: center;
    gap: 5%;
    font-size: clamp(2.5em, 4vw, 4em);
    margin-top: 20%;
    opacity: 0.3;
}

.pull-quote {
    font-size: clamp(1.3em, 2.5vw, 2.2em);
    font-style: italic;
    color: #c86dd7;
    line-height: 1.5;
    margin-top: 15%;
    padding-left: 4%;
    border-left: 5px solid #ff6b9d;
    text-align: left;
}

/* Reasons List */
.reasons-list {
    display: flex;
    flex-direction: column;
    gap: 4%;
    margin-top: 3%;
}

.reason-item {
    display: flex;
    gap: 3%;
    align-items: flex-start;
}

.reason-number {
    flex-shrink: 0;
    width: clamp(35px, 5vw, 50px);
    height: clamp(35px, 5vw, 50px);
    background: linear-gradient(135deg, #ff6b9d, #c86dd7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: clamp(0.9em, 1.3vw, 1.1em);
}

.reason-item p {
    font-size: clamp(0.95em, 1.3vw, 1.1em);
    line-height: 1.7;
    color: #333;
    padding-top: 1%;
}

/* Thank You List */
.thank-you-list {
    display: flex;
    flex-direction: column;
    gap: 3%;
    margin-top: 4%;
}

.thank-you-item {
    display: flex;
    gap: 3%;
    align-items: flex-start;
    padding: 2%;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.thank-you-item:hover {
    transform: translateX(5px);
}

.thank-you-number {
    flex-shrink: 0;
    width: clamp(30px, 4vw, 40px);
    height: clamp(30px, 4vw, 40px);
    background: linear-gradient(135deg, #ff6b9d, #c86dd7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: clamp(0.9em, 1.2vw, 1em);
}

.thank-you-item p {
    font-size: clamp(1em, 1.4vw, 1.15em);
    line-height: 1.7;
    color: #333;
    padding-top: 0.3em;
}

.thank-you-note {
    text-align: center;
    font-style: italic;
    color: #c86dd7;
    font-size: clamp(1.1em, 1.5vw, 1.3em);
    margin-top: 5%;
    line-height: 1.6;
}

/* Photo Pages */
.photo-page {
    background: #fafafa;
}

.photo-page::before {
    background: rgba(250, 250, 250, 0.9);
}

.photo-layout {
    margin-top: 4%;
}

.favorite-photo {
    width: 100%;
    height: auto;
    max-height: 65%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 3%;
}

.photo-placeholder {
    background: linear-gradient(135deg, #ffeef8, #ffe0f0);
    border: 3px dashed #ff6b9d;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff6b9d;
    font-size: clamp(0.9em, 1.2vw, 1em);
    text-align: center;
    font-weight: bold;
}

.photo-placeholder.large {
    height: 65%;
    font-size: clamp(1em, 1.4vw, 1.2em);
}

.photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3%;
    margin-top: 4%;
}

.photo-grid .photo-placeholder {
    aspect-ratio: 1;
}

.grid-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    aspect-ratio: 1;
}

.photo-caption {
    text-align: center;
    font-style: italic;
    color: #c86dd7;
    margin-top: 3%;
    font-size: clamp(0.95em, 1.3vw, 1.1em);
}

/* Timeline */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 5%;
    margin-top: 4%;
}

.timeline-item {
    display: flex;
    gap: 3%;
    align-items: flex-start;
}

.timeline-marker {
    font-size: clamp(1.8em, 2.8vw, 2.5em);
    flex-shrink: 0;
}

.timeline-text h3 {
    color: #c86dd7;
    font-size: clamp(1.2em, 1.8vw, 1.6em);
    margin-bottom: 2%;
}

.timeline-text p {
    color: #666;
    font-size: clamp(0.95em, 1.3vw, 1.1em);
    font-style: italic;
    line-height: 1.6;
}

/* Quotes */
.quote-box {
    background: linear-gradient(135deg, #ffeef8, #ffe0f0);
    padding: 5%;
    border-radius: 8px;
    margin-bottom: 4%;
    border-left: 5px solid #ff6b9d;
}

.quote-text {
    font-size: clamp(1.1em, 1.6vw, 1.4em);
    font-style: italic;
    color: #333;
    line-height: 1.7;
    margin-bottom: 3%;
}

.quote-author {
    text-align: right;
    color: #c86dd7;
    font-size: clamp(0.95em, 1.3vw, 1.1em);
    font-weight: bold;
}

/* Quote Image Page */
.quote-image-page .page-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.quote-image-container {
    width: 70%;
    max-width: 400px;
    margin-bottom: 5%;
}

.quote-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.image-quote {
    font-size: clamp(1.3em, 2.5vw, 2.2em);
    font-style: italic;
    color: #c86dd7;
    line-height: 1.5;
    text-align: center;
    padding: 0 5%;
    border: none;
}

/* Spotify Page */
.spotify-page .page-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.spotify-text {
    font-size: clamp(1em, 1.4vw, 1.15em);
    line-height: 1.8;
    color: #333;
    margin-bottom: 5%;
    max-width: 80%;
    font-style: italic;
}

.spotify-container {
    width: 85%;
    max-width: 500px;
    margin: 3% 0;
}

.spotify-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.spotify-caption {
    font-size: clamp(1em, 1.3vw, 1.1em);
    font-style: italic;
    color: #c86dd7;
    margin-top: 4%;
}

/* Personal Note */
.centered-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.personal-note {
    text-align: center;
    padding: 6%;
    background: linear-gradient(135deg, #ffeef8, #ffe0f0);
    border: 3px solid #ff6b9d;
    border-radius: 15px;
}

.note-intro {
    font-size: clamp(0.95em, 1.3vw, 1.1em);
    color: #999;
    margin-bottom: 3%;
}

.personal-note h3 {
    color: #c86dd7;
    font-size: clamp(1.3em, 2.2vw, 2em);
    line-height: 1.6;
}

/* Back Cover */
.back-cover .page-content {
    background: linear-gradient(135deg, #ffeef8 0%, #ffb3d9 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #c86dd7;
}

.back-cover::before {
    background: linear-gradient(135deg, rgba(255, 238, 248, 0.95) 0%, rgba(255, 179, 217, 0.95) 100%);
}

.heart-large {
    font-size: clamp(4em, 6vw, 6em);
    margin-bottom: 4%;
}

.back-cover h2 {
    font-size: clamp(2em, 4vw, 3.5em);
    margin-bottom: 5%;
    color: #c86dd7;
}

.final-message {
    font-size: clamp(1.1em, 1.6vw, 1.4em);
    line-height: 1.8;
    margin: 3% 0;
    max-width: 80%;
}

.signature-large {
    font-size: clamp(1.5em, 2.5vw, 2.2em);
    margin-top: 5%;
    font-style: italic;
    font-weight: bold;
}

/* Controls - Flip hints at bottom corners of flipbook */
.flip-hint {
    position: absolute;
    bottom: -50px;
    font-size: clamp(0.65em, 0.8vw, 0.75em);
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Georgia', serif;
    font-style: italic;
    transition: opacity 0.3s ease;
    animation: subtlePulse 3s ease-in-out infinite;
}

.flip-hint-right {
    right: 0;
}

.flip-hint-left {
    left: 0;
    display: none; /* Hide initially */
}

.hint-text {
    /* No extra styling needed */
}

@keyframes subtlePulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.8; }
}

/* Hide hints after first interaction */
.hints-hidden .flip-hint {
    opacity: 0;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 1280px) {
    #flipbook {
        width: 840px;  /* Double smaller width (420 x 2) */
        height: 595px;
    }
    
    #flipbook .magazine-page {
        width: 420px;
        height: 595px;
    }
    
    .page-content {
        padding: 40px 30px;
    }
    
    .magazine-title {
        font-size: 2.5em;
    }
    
    h2 {
        font-size: 2em;
    }
    
    .section-title {
        font-size: 2.2em;
    }
    
    .controls {
        padding: 15px 25px;
    }
    
    .btn-text {
        display: none;
    }
}

@media (max-width: 768px) {
    #flipbook {
        width: 420px;
        height: 595px;
    }
    
    .magazine-page {
        width: 420px;
        height: 595px;
    }
    
    .page-content {
        padding: 40px 30px;
    }
    
    .magazine-title {
        font-size: 2.5em;
    }
    
    h2 {
        font-size: 2em;
    }
    
    .section-title {
        font-size: 2.2em;
    }
    
    .controls {
        padding: 15px 25px;
    }
    
    .btn-text {
        display: none;
    }
}
