/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Indie Flower', 'Comic Sans MS', cursive, sans-serif;
}

body {
    background-color: #feeaff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M30,10 Q50,20 70,10 T90,30 T70,50 T90,70 T70,90 T50,70 T30,90 T10,70 T30,50 T10,30 T30,10" fill="none" stroke="rgba(255,182,193,0.5)" stroke-width="3"/></svg>');
    background-size: 300px 300px;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(255,255,255,0.8) 10%, transparent 10%);
    background-size: 30px 30px;
    pointer-events: none;
    opacity: 0.3;
    z-index: 0;
}

/* Book Container */
.book-container {
    perspective: 2000px;
    width: 90vw;
    max-width: 900px;
    height: 80vh;
    max-height: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.book {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

/* Book Cover */
.book-cover {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #ff85a2, #ff99cc);
    color: white;
    text-align: center;
    padding: 20px;
    border-radius: 15px 0 0 15px;
    box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.3);
    backface-visibility: hidden;
    border: 15px solid #ffd1dc;
    border-right: 5px solid #ffd1dc;
    z-index: 2;
    background-image: url('data:image/svg+xml;utf8,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><path d="M30 10C35 20 45 10 50 20C55 30 45 40 50 50C45 60 35 50 30 60C25 50 15 60 10 50C5 40 15 30 10 20C15 10 25 20 30 10Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 120px 120px;
    background-repeat: repeat;
}

.book-cover::after {
    content: '';
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 80px;
    height: 80px;
    background-image: url('data:image/svg+xml;utf8,<svg width="80" height="80" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><path d="M40 10C50 0 70 20 40 40C10 20 30 0 40 10Z" fill="rgba(255,255,255,0.3)"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.7;
    z-index: 1;
}

.book-cover h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    margin-bottom: 10px;
    text-shadow: 3px 3px 5px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
}

.book-cover h2 {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.2);
}

.book-cover .date {
    font-size: 1.2rem;
    margin-bottom: 30px;
    font-style: italic;
}

.book-cover .subtitle {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    margin-top: 20px;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.cover-image {
    width: 60%;
    height: 40%;
    background-color: rgba(255, 255, 255, 0.3);
    border: 10px solid white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.cover-image:hover {
    transform: scale(1.05);
}

.cover-image::before {
    content: "♥";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Pages */
.page {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 0 15px 15px 0;
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transform-origin: left center;
    transform: rotateY(180deg);
    backface-visibility: hidden;
    display: none;
    background-image: url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M0,0 L40,0 L40,40 L0,40 L0,0 Z" fill="none" stroke="rgba(200,200,200,0.1)" stroke-width="0.5"/></svg>');
}

.page::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 40px 40px 0;
    border-color: transparent #ffd1dc transparent transparent;
    filter: drop-shadow(-2px 2px 2px rgba(0, 0, 0, 0.1));
}

.page-content {
    height: 100%;
    overflow: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page h2 {
    font-family: 'Dancing Script', cursive;
    text-align: center;
    color: #ff6b9d;
    margin-bottom: 20px;
    font-size: 2.2rem;
    border-bottom: 2px dashed #ffd1dc;
    padding-bottom: 10px;
    width: 100%;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.page p {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #555;
    text-align: center;
    line-height: 1.5;
}

/* Active Page */
.page.active {
    display: block;
    z-index: 1;
}

.book.open .book-cover {
    transform: rotateY(-180deg);
}

/* Memory Box */
.memory-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    width: 100%;
}

.polaroid {
    background-color: white;
    padding: 15px 15px 40px 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transform: rotate(-3deg);
    transition: transform 0.3s ease;
    margin: 15px;
    max-width: 300px;
    position: relative;
}

.polaroid::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.polaroid:hover {
    transform: rotate(0) scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 5;
}

.placeholder-image {
    width: 250px;
    height: 200px;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
    position: relative;
    overflow: hidden;
}

.placeholder-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0) 60%, rgba(0,0,0,0.1) 100%);
    pointer-events: none;
}

.placeholder-image::after {
    content: attr(data-label);
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.caption {
    margin-top: 10px;
    text-align: center;
    font-family: 'Indie Flower', cursive;
    font-size: 1.1rem;
}

.note {
    background-color: #ffffa5;
    padding: 15px;
    box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.15);
    transform: rotate(2deg);
    max-width: 280px;
    margin: 20px auto;
    position: relative;
    transition: transform 0.3s ease;
}

.note:hover {
    transform: rotate(0) scale(1.05);
}

.note::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 10px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.note p {
    margin: 5px 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

.special-note {
    background-color: #ffc9e0;
}

/* About Box */
.about-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 20px 0;
}

.heart-container {
    margin: 20px 0;
}

.heart {
    position: relative;
    width: 100px;
    height: 90px;
    margin: 0 auto;
}

.heart:before,
.heart:after {
    position: absolute;
    content: "";
    left: 50px;
    top: 0;
    width: 50px;
    height: 80px;
    background: #ff6b9d;
    border-radius: 50px 50px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
    animation: pulse 1.5s infinite alternate;
}

.heart:after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

.blue-heart .heart:before,
.blue-heart .heart:after {
    background: #7ba3ff;
}

@keyframes pulse {
    0% {
        transform: rotate(-45deg) scale(0.8);
    }
    100% {
        transform: rotate(-45deg) scale(1.0);
    }
}

.qualities-list {
    list-style-type: none;
    margin: 20px 0;
    padding: 0;
    width: 80%;
    max-width: 350px;
}

.qualities-list li {
    position: relative;
    padding: 10px 10px 10px 35px;
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: #555;
    background-color: rgba(255, 214, 228, 0.5);
    border-radius: 10px;
    transition: transform 0.2s ease;
}

.qualities-list li:hover {
    transform: translateX(10px);
}

.qualities-list li::before {
    content: "❤";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #ff6b9d;
}

.blue-list li {
    background-color: rgba(214, 228, 255, 0.5);
}

.blue-list li::before {
    color: #7ba3ff;
}

/* Timeline */
.timeline {
    margin: 30px 0;
    width: 90%;
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, #ff85a2, #7ba3ff);
}

.timeline-item {
    margin-bottom: 20px;
    position: relative;
}

.timeline-dot {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #ff85a2;
    box-shadow: 0 0 0 4px rgba(255, 133, 162, 0.2);
}

.timeline-content {
    margin-left: 55%;
    background-color: rgba(255, 214, 228, 0.3);
    padding: 10px 15px;
    border-radius: 8px;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 10px;
    left: -10px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 10px 8px 0;
    border-color: transparent rgba(255, 214, 228, 0.3) transparent transparent;
}

.timeline-date {
    font-weight: bold;
    color: #ff6b9d;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

/* Memory Grid */
.memory-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

/* Add Memory Form */
.add-memory-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 40px;
    position: relative;
}

.add-memory-form::before,
.add-memory-form::after {
    content: '♥';
    position: absolute;
    font-size: 1.5rem;
    color: #ff85a2;
    animation: float-heart 3s infinite ease-in-out alternate;
}

.add-memory-form::before {
    top: -20px;
    left: 30%;
    animation-delay: 0.5s;
}

.add-memory-form::after {
    bottom: -20px;
    right: 30%;
    animation-delay: 1s;
}

@keyframes float-heart {
    0% {
        transform: translateY(0) rotate(-10deg);
    }
    100% {
        transform: translateY(-10px) rotate(10deg);
    }
}

#add-memory-btn {
    background: linear-gradient(135deg, #ff85a2, #ff6b9d);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    font-family: 'Indie Flower', cursive;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

#add-memory-btn i {
    margin: 0 5px;
    font-size: 0.9rem;
    animation: beat 1s infinite alternate;
}

#add-memory-btn i:first-child {
    animation-delay: 0.5s;
}

@keyframes beat {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.3);
    }
}

#add-memory-btn:hover {
    background: linear-gradient(135deg, #ff6b9d, #ff5a8a);
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

#add-memory-btn::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    opacity: 0;
}

#add-memory-btn:hover::before {
    opacity: 1;
}

.love-quote {
    font-family: 'Dancing Script', cursive;
    font-size: 1.4rem;
    color: #ff6b9d;
    text-align: center;
    margin-top: 30px;
    position: relative;
}

.love-quote::before,
.love-quote::after {
    content: '❤';
    position: absolute;
    top: 0;
    color: #ff85a2;
    font-size: 1rem;
}

.love-quote::before {
    left: -20px;
}

.love-quote::after {
    right: -20px;
}

/* Navigation Buttons */
.navigation {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 30px;
    z-index: 10;
}

.nav-btn {
    background: linear-gradient(135deg, #ff99cc, #ff85a2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-btn i {
    transition: transform 0.3s ease;
}

.nav-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
}

.nav-btn:hover::after {
    transform: translate(-50%, -50%) scale(10);
}

.nav-btn:hover i {
    transform: scale(1.3);
}

.nav-btn:hover {
    background: linear-gradient(135deg, #ff85a2, #ff6b9d);
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.nav-btn:disabled {
    background: linear-gradient(135deg, #cccccc, #bbbbbb);
    cursor: not-allowed;
    box-shadow: none;
}

.nav-btn:disabled::after {
    display: none;
}

/* Memory Modal */
.memory-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background-image: url('data:image/svg+xml;utf8,<svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M20,10 Q25,0 30,10 T40,20 T30,30 T20,40 T10,30 T0,20 T10,10 T20,0" fill="none" stroke="rgba(255,182,193,0.2)" stroke-width="1"/></svg>');
    background-size: 100px 100px;
    position: relative;
}

.modal-content::before,
.modal-content::after {
    content: '❤';
    position: absolute;
    color: #ff85a2;
    font-size: 1.5rem;
    top: -15px;
}

.modal-content::before {
    left: 20px;
}

.modal-content::after {
    right: 20px;
}

.modal-content h3 {
    font-family: 'Dancing Script', cursive;
    color: #ff6b9d;
    text-align: center;
    margin-bottom: 20px;
    font-size: 2rem;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: bold;
    color: #555;
    font-size: 1.1rem;
}

.form-group input, .form-group textarea {
    padding: 12px;
    border: 1px solid #ffd1dc;
    border-radius: 8px;
    font-family: 'Indie Flower', cursive;
    font-size: 1rem;
    transition: border 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border: 1px solid #ff85a2;
    box-shadow: 0 0 5px rgba(255, 133, 162, 0.5);
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.modal-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Indie Flower', cursive;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.modal-save {
    background: linear-gradient(135deg, #ff85a2, #ff6b9d);
    color: white;
}

.modal-save:hover {
    background: linear-gradient(135deg, #ff6b9d, #ff5a8a);
    transform: scale(1.05);
}

.modal-cancel {
    background-color: #f0f0f0;
    color: #555;
}

.modal-cancel:hover {
    background-color: #e0e0e0;
    transform: scale(1.05);
}

/* Floating Hearts Animation */
.floating-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

@keyframes float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) scale(1);
        opacity: 0;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .book-container {
        height: 70vh;
    }
    
    .book-cover h1 {
        font-size: 3rem;
    }
    
    .book-cover h2 {
        font-size: 2rem;
    }
    
    .polaroid {
        max-width: 250px;
    }
    
    .placeholder-image {
        width: 220px;
        height: 170px;
    }
    
    .qualities-list {
        width: 90%;
    }
    
    .timeline-content {
        margin-left: 52%;
    }
}

@media (max-width: 480px) {
    .book-container {
        height: 85vh;
    }
    
    .book-cover h1 {
        font-size: 2.5rem;
    }
    
    .page h2 {
        font-size: 1.8rem;
    }
    
    .polaroid {
        max-width: 200px;
    }
    
    .placeholder-image {
        width: 170px;
        height: 140px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .qualities-list li {
        font-size: 1rem;
        padding: 8px 8px 8px 30px;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-dot {
        left: 20px;
    }
    
    .timeline-content {
        margin-left: 40px;
        width: calc(100% - 50px);
    }
    
    .timeline-content::before {
        left: -8px;
        border-width: 6px 8px 6px 0;
    }
} 