/* public/style.css */
:root {
    --primary-rose: #ff527b;
    --primary-gradient: linear-gradient(135deg, #ff527b 0%, #ff7eb3 100%);
    --secondary-gradient: linear-gradient(135deg, #ff7eb3 0%, #ffb199 100%);
    --bg-blush: #fff5f8;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #3a1e28;
    --text-muted: #7d606c;
    --border-color: #ffd8e4;
    --shadow-soft: 0 10px 30px rgba(255, 82, 123, 0.12);
    --shadow-hover: 0 15px 35px rgba(255, 82, 123, 0.22);
    --radius-lg: 20px;
    --radius-md: 12px;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-blush);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Floating Hearts Background */
#floating-hearts-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-heart {
    position: absolute;
    bottom: -50px;
    font-size: 20px;
    color: rgba(255, 82, 123, 0.25);
    animation: floatUp 10s linear infinite;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg) scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: translateY(-110vh) rotate(360deg) scale(1.3);
        opacity: 0;
    }
}

/* View Toggling */
.view {
    display: none;
    position: relative;
    z-index: 1;
}

.view.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- AUTH (LOGIN / REGISTER) SCREEN --- */
#auth-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    max-width: 900px;
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    overflow: hidden;
}

@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
    }
}

.auth-hero {
    background: var(--primary-gradient);
    color: white;
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.romantic-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.romantic-subtitle {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.auth-photo-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    height: 140px;
    width: 100%;
}

.preview-img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: absolute;
    transition: transform 0.3s ease;
}

.preview-img.img-1 {
    left: calc(50% - 85px);
    z-index: 1;
    transform: rotate(-6deg);
}

.preview-img.img-2 {
    left: calc(50% - 25px);
    z-index: 2;
    transform: rotate(6deg);
}

.auth-photo-preview:hover .preview-img.img-1 {
    transform: rotate(-10deg) scale(1.05);
}

.auth-photo-preview:hover .preview-img.img-2 {
    transform: rotate(10deg) scale(1.05);
}

.auth-quote {
    font-size: 0.9rem;
    opacity: 0.9;
    max-width: 80%;
    line-height: 1.5;
}

.auth-box {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    background: var(--bg-blush);
    padding: 0.3rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.6rem;
    border: none;
    background: transparent;
    border-radius: 50px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 82, 123, 0.3);
}

#auth-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    text-align: center;
}

.input-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    background: white;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary-rose);
    box-shadow: 0 0 0 3px rgba(255, 82, 123, 0.15);
}

.primary-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(255, 82, 123, 0.25);
    margin-top: 0.5rem;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.error {
    color: #e63946;
    font-size: 0.85rem;
    margin-top: 0.8rem;
    text-align: center;
    font-weight: 500;
    min-height: 1.2rem;
}

.status-msg {
    color: #2a9d8f;
    font-size: 0.85rem;
    margin-top: 0.8rem;
    text-align: center;
    font-weight: 500;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-rose);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* --- FEED / HOMEPAGE SCREEN --- */
.main-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 15px rgba(255, 82, 123, 0.06);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-icon {
    font-size: 2rem;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    15% {
        transform: scale(1.15);
    }

    30% {
        transform: scale(1);
    }

    45% {
        transform: scale(1.15);
    }
}

.logo-text h1 {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: var(--primary-rose);
    line-height: 1.1;
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.love-badge {
    background: var(--bg-blush);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-rose);
}

.logout-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logout-btn:hover {
    background: #fff0f5;
    border-color: var(--primary-rose);
    color: var(--primary-rose);
}

/* Hero & Lovely Words Section */
.hero-section {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 5%;
    text-align: center;
}

.hero-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2rem;
    box-shadow: var(--shadow-soft);
    background-image: radial-gradient(#ffd8e4 1px, transparent 1px);
    background-size: 20px 20px;
    margin-bottom: 2.5rem;
}

.hero-tag {
    display: inline-block;
    background: var(--primary-gradient);
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.hero-caption {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .love-badge {
        display: none;
    }
}

/* Lovely Words Grid */
.lovely-words-container {
    margin: 3rem 0;
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 25%;
    width: 50%;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.words-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    text-align: left;
}

.word-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.word-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--border-color);
    transition: all 0.3s ease;
}

.word-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.word-card:hover::before {
    background: var(--primary-gradient);
}

.word-card.highlighted {
    background: var(--secondary-gradient);
    color: white;
    border: none;
    box-shadow: var(--shadow-soft);
}

.word-card.highlighted::before {
    display: none;
}

.word-card.highlighted .quote-text,
.word-card.highlighted .quote-author {
    color: white;
}

.word-card.highlighted .quote-icon {
    color: rgba(255, 255, 255, 0.3);
}

.quote-icon {
    font-size: 3rem;
    line-height: 1;
    color: var(--border-color);
    margin-bottom: 0.5rem;
    font-family: serif;
}

.quote-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.quote-author {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-rose);
    align-self: flex-end;
}

/* --- PHOTO GALLERY SECTION --- */
.gallery-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 5%;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.8rem;
}

.gallery-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-rose);
}

.gallery-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%;
    /* 1:1 Aspect Ratio */
    overflow: hidden;
    background: #fdf2f5;
}

.gallery-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 1rem 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.overlay-tag {
    background: var(--primary-gradient);
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.gallery-caption-box {
    padding: 1.2rem;
    text-align: center;
    background: white;
}

.gallery-caption {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
}

/* --- TIMELINE & UPLOAD SECTION --- */
.timeline-section {
    max-width: 1200px;
    margin: 4rem auto 5rem;
    padding: 0 5%;
}

.timeline-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .timeline-layout {
        grid-template-columns: 1fr;
    }
}

.upload-box {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 90px;
}

.upload-header {
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 1rem;
}

.upload-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--text-main);
}

.upload-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-upload-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-upload-btn {
    display: block;
    padding: 0.85rem;
    background: var(--bg-blush);
    border: 1.5px dashed var(--primary-rose);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--primary-rose);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-btn:hover {
    background: #ffe3ec;
}

.file-upload-wrapper input[type="file"] {
    display: none;
}

.file-name-display {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    word-break: break-all;
}

.upload-btn {
    margin-top: 1rem;
}

/* Feed Posts */
.feed-wrapper {
    min-height: 200px;
}

#feed-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-style: italic;
}

.post-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
}

.post-header {
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #f8eaef;
}

.author-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 3px 8px rgba(255, 82, 123, 0.2);
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
}

.post-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-media-container {
    max-height: 600px;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-image,
.post-video {
    width: 100%;
    max-height: 600px;
    object-fit: contain;
    display: block;
}

.post-body {
    padding: 1.5rem;
}

.post-caption {
    font-size: 1rem;
    color: var(--text-main);
    line-height: 1.6;
}

.post-footer {
    padding: 0.8rem 1.5rem;
    background: var(--bg-blush);
    border-top: 1px solid #f8eaef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--primary-rose);
    font-weight: 500;
}

/* --- LIGHTBOX MODAL --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

#lightbox-img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#lightbox-caption {
    margin-top: 1.2rem;
    color: white;
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.2s ease;
}

.modal-close:hover {
    color: var(--primary-rose);
    transform: scale(1.1);
}

.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 1rem 1.2rem;
    font-size: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1001;
}

.modal-prev:hover,
.modal-next:hover {
    background: var(--primary-rose);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev {
    left: 30px;
}

.modal-next {
    right: 30px;
}

@media (max-width: 768px) {
    .modal-prev {
        left: 10px;
        padding: 0.6rem 0.8rem;
    }

    .modal-next {
        right: 10px;
        padding: 0.6rem 0.8rem;
    }

    .modal-close {
        top: 15px;
        right: 20px;
    }
}

/* --- NAVIGATION BUTTONS --- */
.nav-btn {
    background: var(--bg-blush);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-rose);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 2px 8px rgba(255, 82, 123, 0.1);
}

.nav-btn:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 82, 123, 0.25);
}

/* --- LOVE LETTERS PAGE STYLING --- */
.letter-hero {
    padding-bottom: 2rem;
}

.letter-nav-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 2rem;
}

.letter-tab {
    background: white;
    border: 1.5px solid var(--border-color);
    padding: 0.7rem 1.4rem;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
}

.letter-tab:hover {
    border-color: var(--primary-rose);
    color: var(--primary-rose);
    transform: translateY(-2px);
}

.letter-tab.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 15px rgba(255, 82, 123, 0.3);
}

.letter-showcase {
    display: none;
    max-width: 1200px;
    margin: 0 auto 5rem;
    padding: 0 5%;
    animation: fadeIn 0.6s ease;
}

.letter-showcase.active {
    display: block;
}

.letter-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 3rem;
    align-items: start;
}

@media (max-width: 900px) {
    .letter-container {
        grid-template-columns: 1fr;
    }
}

/* Stationery Paper Look */
.stationery-paper {
    background: #fffdfa;
    border: 1px solid #f2e8de;
    border-radius: var(--radius-lg);
    padding: 4rem 3.5rem;
    box-shadow: 0 15px 40px rgba(138, 100, 110, 0.1), inset 0 0 40px rgba(255, 238, 242, 0.4);
    position: relative;
    background-image: linear-gradient(#fcf8f2 1px, transparent 1px);
    background-size: 100% 32px;
    line-height: 32px;
}

@media (max-width: 768px) {
    .stationery-paper {
        padding: 2.5rem 1.5rem;
    }
}

.wax-seal {
    position: absolute;
    top: -20px;
    right: 40px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #d90429 0%, #ef233c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: white;
    box-shadow: 0 6px 15px rgba(217, 4, 41, 0.3);
    border: 3px solid #ffccd5;
    transform: rotate(15deg);
}

.letter-header {
    border-bottom: 2px dashed var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.letter-date {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-rose);
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.letter-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--text-main);
    line-height: 1.3;
}

.letter-body p {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: #4a2c38;
    margin-bottom: 1.8rem;
    line-height: 1.8;
}

.letter-signoff {
    margin-top: 3rem;
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: var(--primary-rose);
    line-height: 1.4;
}

.signoff-name {
    font-size: 2.5rem;
    font-weight: bold;
}

.letter-footer-actions {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.action-btn {
    background: var(--bg-blush);
    border: 1px solid var(--primary-rose);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--primary-rose);
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--primary-rose);
    color: white;
    transform: scale(1.05);
}

/* Scrapbook Sidebar */
.scrapbook-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.scrapbook-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--text-main);
    text-align: center;
    width: 100%;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.polaroid-card {
    background: white;
    padding: 1rem 1rem 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    border: 1px solid #efefef;
    width: 100%;
    max-width: 320px;
    transition: transform 0.3s ease;
    position: relative;
}

.polaroid-card::after {
    content: '';
    position: absolute;
    top: -12px;
    left: 35%;
    width: 30%;
    height: 25px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transform: rotate(-3deg);
}

.polaroid-card.rotate-left {
    transform: rotate(-3deg);
}

.polaroid-card.rotate-right {
    transform: rotate(3deg);
}

.polaroid-card:hover {
    transform: rotate(0deg) scale(1.05);
    z-index: 10;
}

.polaroid-img-box {
    width: 100%;
    height: 260px;
    overflow: hidden;
    background: #f8f8f8;
    margin-bottom: 1rem;
}

.polaroid-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.polaroid-card:hover .polaroid-img-box img {
    transform: scale(1.08);
}

.polaroid-caption {
    font-family: 'Dancing Script', cursive;
    font-size: 1.4rem;
    color: var(--text-main);
    text-align: center;
}

.photo-selector-buttons {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
}

.photo-selector-buttons button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-blush);
    color: var(--primary-rose);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.photo-selector-buttons button:hover {
    background: var(--primary-rose);
    color: white;
}

/* Hug Modal */
.hug-popup {
    background: white;
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 450px;
    border: 2px solid var(--border-color);
}

.hug-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    animation: heartbeat 1s infinite;
}

.hug-popup h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 0.8rem;
}

.hug-popup p {
    color: var(--text-muted);
    margin-bottom: 1.8rem;
    line-height: 1.6;
}

/* --- MOBILE HEADER FIX --- */
@media screen and (max-width: 768px) {
    .main-header {
        flex-direction: column;
        /* Stacks the logo and buttons vertically */
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
        height: auto;
        /* Allows the header to expand as needed */
    }

    .header-logo {
        justify-content: center;
        /* Centers the icon and text */
        width: 100%;
    }

    .header-actions {
        justify-content: center;
        flex-wrap: wrap;
        /* Allows buttons to drop to the next line if needed */
        width: 100%;
        gap: 0.8rem;
    }

    .logo-text h1 {
        font-size: 2.2rem;
        /* Slightly adjusts font size for mobile */
    }
}

/* --- TOGGLEABLE 3x3 GRID MODE --- */
.grid-3x3-mode {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2px !important;
    padding: 2px !important;
}

.grid-3x3-mode .gallery-item {
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.grid-3x3-mode .gallery-img-wrapper {
    aspect-ratio: 1 / 1 !important; /* Perfect squares */
    border-radius: 0 !important;
}

.grid-3x3-mode .gallery-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
}

/* Hide captions in grid mode to keep it clean */
.grid-3x3-mode .gallery-caption-box {
    display: none !important;
}

/* Shrink buttons for the tiny squares */
.grid-3x3-mode .overlay-tag {
    font-size: 0.6rem !important;
    padding: 0.2rem 0.3rem !important;
}

/* Add a nice style for our toggle button */
.view-toggle-btn {
    background: white;
    border: 1px solid #ffd8e4;
    color: #ff527b;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.view-toggle-btn:hover {
    background: #fff0f5;
}