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

:root {
    --champagne-pink: #FFE5D9;
    --ash-gray: #98B6B1;
    --lavender-floral: #b491de;
    --rose-pompadour: #eb7093;
    --ghost-white: #f4f4f8;
    --flax: #faf19e;
    --pink-lavender: #f9c8f0;

    --color-memory: var(--champagne-pink);
    --color-first: var(--lavender-floral);
    --color-milestone: var(--ash-gray);
    --color-event: var(--rose-pompadour);

    --background: #FCF9F3;
    --text-dark: #333333;
    --text-light: #666666;
    --text-lighter: #999999;
    --card-bg: #ffffff;
    --border-light: #f0f0f0;
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-elevated: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    background: var(--background);
    color: var(--text-dark);
    line-height: 1.8;
    min-height: 100vh;
    letter-spacing: -0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Page */
.login-page {
    width: 100%;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--lavender-floral) 0%, var(--rose-pompadour) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -200px;
    right: -200px;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    bottom: -150px;
    left: -150px;
}

.login-container {
    position: relative;
    z-index: 2;
}

.login-content {
    background: white;
    padding: 4rem 3rem;
    border-radius: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 450px;
    width: 90vw;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-title {
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.login-subtitle {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-light);
    margin-bottom: 3rem;
    letter-spacing: 0.01em;
}

.google-signin-btn {
    width: 100%;
    background: white;
    color: var(--text-dark);
    border: 1.5px solid var(--border-light);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-subtle);
}

.google-signin-btn:hover {
    background: var(--background);
    border-color: var(--lavender-floral);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.google-signin-btn:active {
    transform: translateY(0);
}

.google-icon {
    flex-shrink: 0;
}

.login-note {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: var(--text-lighter);
    font-weight: 300;
}

/* Home Page - Modern Flowing Design */
.home-page {
    width: 100%;
    height: 100vh;
    position: relative;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.home-photo-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-photo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--ghost-white) 0%, var(--champagne-pink) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.home-photo-container img.slideshow-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.85) saturate(1.1);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.home-photo-container img.slideshow-photo.active {
    opacity: 1;
}

/* Slideshow dots */
.slideshow-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.slideshow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slideshow-dot.active {
    background: var(--rose-pompadour);
    transform: scale(1.3);
}

.slideshow-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Subtle gradient overlay on home image */
.home-photo-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.2) 0%,
        transparent 30%,
        transparent 70%,
        rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: 1;
}

.home-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 2;
    width: 90%;
    max-width: 800px;
}

.home-title {
    font-family: 'Lato', sans-serif;
    font-size: 5rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-subtitle {
    font-family: 'Lato', sans-serif;
    font-size: 1.35rem;
    font-weight: 300;
    margin-bottom: 3.5rem;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    opacity: 0.9;
    animation: fadeInUp 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.explore-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 1.1rem 3rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 300;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 1.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.explore-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    border-color: rgba(255, 255, 255, 0.95);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.upload-photo-btn {
    position: absolute;
    bottom: 2.5rem;
    right: 2.5rem;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.8rem 1.75rem;
    border-radius: 40px;
    font-size: 0.875rem;
    font-weight: 300;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    backdrop-filter: blur(20px);
}

.upload-photo-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    border-color: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

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

/* Main Navigation - Modern Flowing Design */
.main-nav {
    background: rgba(250, 250, 250, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(30px) saturate(180%);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(180, 145, 222, 0.2);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(180, 145, 222, 0.2);
    transition: border-color 0.3s ease;
}

.user-profile:hover .user-avatar {
    border-color: var(--lavender-floral);
}

.user-name {
    font-size: 0.9rem;
    font-weight: 300;
    color: var(--text-dark);
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Add Event Button in Navigation */
.add-event-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--lavender-floral);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 400;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(180, 145, 222, 0.25);
}

.add-event-nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(180, 145, 222, 0.35);
    background: var(--rose-pompadour);
}

.add-event-nav-btn svg {
    flex-shrink: 0;
}

.nav-title {
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 300;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-title:hover {
    color: var(--lavender-floral);
    transform: translateX(-2px);
}

/* Hamburger Button */
.hamburger-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 0;
    transition: all 0.3s ease;
}

.hamburger-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger-btn:hover span {
    background: var(--lavender-floral);
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Hamburger Menu - Modern Flowing Design */
.hamburger-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0 0 0 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 2rem 0;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-15px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.hamburger-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hamburger-menu a {
    display: block;
    padding: 10px 25px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 300;
    transition: all 0.3s ease;
    letter-spacing: 0.01em;
}

.hamburger-menu a:hover {
    background: rgba(180, 145, 222, 0.08);
    color: var(--lavender-floral);
    padding-left: 2.5rem;
}

.sign-out-link {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: 0.75rem;
    padding-top: 1.5rem !important;
    color: var(--rose-pompadour) !important;
}

.sign-out-link:hover {
    background: rgba(235, 112, 147, 0.08) !important;
}

/* Submenu styles */
.menu-item-with-submenu {
    position: relative;
}

.menu-item-with-submenu .menu-item-main {
    display: inline-block;
    width: calc(100% - 40px);
}

.submenu-toggle {
    position: absolute;
    right: 25px;
    top: 10px;
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--text-dark);
    transition: transform 0.3s ease;
    user-select: none;
    padding: 5px;
}

.submenu-toggle.expanded {
    transform: rotate(90deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.submenu.expanded {
    max-height: 300px;
}

.submenu a {
    padding-left: 45px !important;
    font-size: 0.9rem;
}

.submenu a:hover {
    padding-left: 50px !important;
}

/* App Container */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem;
    min-height: calc(100vh - 80px);
}

/* Page Structure */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 3rem;
    font-weight: 300;
    letter-spacing: -0.03em;
    color: var(--text-dark);
}

/* Logged-in user indicator */
.logged-in-indicator {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--lavender-floral);
    opacity: 0.7;
    letter-spacing: 0.02em;
}

/* Header right section (for logged-in indicator + button) */
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Filter Toggles - Modern Flowing Design */
.filter-toggles {
    display: flex;
    gap: 1rem;
    margin-bottom: 4rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 300;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-btn.active[data-filter="memories"] {
    background: rgba(255, 229, 217, 0.3);
    border-color: var(--color-memory);
    color: var(--text-dark);
}

.filter-btn.active[data-filter="firsts"] {
    background: rgba(180, 145, 222, 0.3);
    border-color: var(--color-first);
    color: var(--text-dark);
}

.filter-btn.active[data-filter="milestones"] {
    background: rgba(152, 182, 177, 0.3);
    border-color: var(--color-milestone);
    color: var(--text-dark);
}

.filter-btn.active[data-filter="events"] {
    background: rgba(235, 112, 147, 0.3);
    border-color: var(--color-event);
    color: var(--text-dark);
}

.filter-btn:not(.active) {
    opacity: 0.4;
}

.filter-btn:hover {
    transform: translateY(-2px);
    opacity: 1;
    border-color: var(--lavender-floral);
}

/* Timeline Posts - Alternating Grid Layout with Seasonal Backgrounds */
.timeline-posts {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Seasonal section backgrounds */
.season-section {
    padding: 3rem 0;
    margin-bottom: 2rem;
    border-radius: 20px;
    transition: background 0.8s ease;
}

.season-section.winter {
    background: transparent;
}

.season-section.spring {
    background: transparent;
}

.season-section.summer {
    background: transparent;
}

.season-section.autumn {
    background: transparent;
}

.timeline-post {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    margin-bottom: 70px;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Posts without images - single column layout */
.timeline-post:not(.has-image):not(.auto-generated) {
    grid-template-columns: 1fr;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.timeline-post:not(.has-image):not(.auto-generated) .post-content {
    order: 1 !important;
}

.timeline-post:not(.has-image):not(.auto-generated) .post-header {
    justify-content: center;
    align-items: center;
}

.timeline-post:not(.has-image):not(.auto-generated) .post-actions {
    justify-content: center;
}

/* Visible state for scroll animations */
.timeline-post.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Auto-generated milestones - subtle centered bookend style */
.timeline-post.auto-generated {
    display: block;
    text-align: center;
    padding: 12px 18px;
    margin: 20px auto;
    max-width: 400px;
    grid-template-columns: none;
    background: linear-gradient(135deg, rgba(235, 112, 147, 0.03), rgba(250, 241, 158, 0.03));
    border: 1px solid rgba(235, 112, 147, 0.1);
    border-radius: 10px;
}

@media (max-width: 768px) {
    .timeline-post.auto-generated {
        padding: 16px 20px;
        max-width: 100%;
    }
}

.timeline-post.auto-generated .post-image-container {
    display: none;
}

.timeline-post.auto-generated .post-content {
    width: 100%;
    max-width: none;
}

.timeline-post.auto-generated .post-title {
    font-size: 0.95rem;
    font-weight: 300;
    color: #606060;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
    opacity: 0.85;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.timeline-post.auto-generated .post-type-badge {
    font-size: 0.6rem;
    color: var(--ash-gray);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.7;
    background: white;
    padding: 2px 8px;
    border-radius: 8px;
    display: inline-block;
}

.timeline-post.auto-generated .post-date {
    font-size: 0.8rem;
    color: #666666;
    margin-bottom: 6px;
}

.timeline-post.auto-generated .post-description {
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    margin-top: 3px;
}

/* Event dividers - elegant separators */
.event-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(180, 145, 222, 0.2), transparent);
    max-width: 600px;
    margin: 25px auto;
}

/* Alternating layout - text left, image right for odd posts */
.timeline-post:nth-child(odd) .post-content {
    order: 1;
}

.timeline-post:nth-child(odd) .post-image-container {
    order: 2;
}

/* Alternating layout - image left, text right for even posts */
.timeline-post:nth-child(even) .post-content {
    order: 2;
}

.timeline-post:nth-child(even) .post-image-container {
    order: 1;
}

.timeline-post.hidden {
    display: none;
}

.timeline-post.auto-generated .post-date {
    opacity: 0.9;
}

/* Image container for timeline */
.timeline-post .post-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    width: 100%;
    background: #FCF9F3; /* Phase 4: Cream background around photos */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.timeline-post .post-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover; /* Phase 4: Default to cover (fills container for landscape) */
    display: block;
    margin: 0 auto;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Phase 4: Portrait single photos should use contain */
.timeline-post .post-image.portrait {
    object-fit: contain; /* Show full portrait photo without cropping */
    max-height: 500px;
    width: auto;
    max-width: 100%;
}

/* Image gradient overlay */
.timeline-post .post-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.15) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Image hover effect */
.timeline-post:hover .post-image {
    transform: scale(1.02);
}

.anniversary-placeholder {
    background: linear-gradient(135deg, var(--champagne-pink) 0%, var(--pink-lavender) 50%, var(--flax) 100%);
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-post .post-content {
    padding: 0;
    background: none;
    border: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Event type styling - FIRSTS (Typography Only) */
.timeline-post.first .post-type-badge,
.timeline-post.first .post-title {
    color: #b491de;
}

.timeline-post.first .post-date {
    color: #666666;
}

/* Event type styling - MEMORIES (Typography Only) */
.timeline-post.memory .post-type-badge,
.timeline-post.memory .post-title {
    color: #eb7093;
}

.timeline-post.memory .post-date {
    color: #666666;
}

/* Event type styling - MILESTONES (Typography Only) */
.timeline-post.milestone .post-type-badge,
.timeline-post.milestone .post-title {
    color: #2C3E50;
}

.timeline-post.milestone .post-date {
    color: #666666;
}

/* Event type styling - EVENTS (Typography Only) */
.timeline-post.event .post-type-badge,
.timeline-post.event .post-title {
    color: #eb7093;
}

.timeline-post.event .post-date {
    color: #666666;
}

.post-header {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
}

/* Enhanced typography - Event type label */
.post-type-badge {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.post-type-badge.anniversary {
    font-style: italic;
}

/* Enhanced typography - Date */
.post-date {
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 1px;
    color: #666666;
    opacity: 1;
    margin-bottom: 15px;
}

/* Enhanced typography - Title */
.post-title {
    font-size: 2.2rem;
    font-weight: 300;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow: hidden;
}

/* Enhanced typography - Description */
.post-description {
    color: #666;
    line-height: 1.9;
    font-weight: 300;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow: hidden;
}

/* Icon buttons - hidden by default, visible on hover */
.post-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-top: 8px;
}

.timeline-post:hover .post-actions {
    opacity: 1;
}

.post-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.post-btn:hover {
    background: var(--background);
    border-color: var(--lavender-floral);
}

.post-btn.delete:hover {
    background: var(--rose-pompadour);
    border-color: var(--rose-pompadour);
}

/* Icon styles */
.post-btn svg {
    width: 16px;
    height: 16px;
    stroke: #999;
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.3s ease;
}

.post-btn:hover svg {
    stroke: var(--lavender-floral);
}

.post-btn.delete:hover svg {
    stroke: white;
}

.auto-badge {
    font-size: 0.75rem;
    color: var(--text-lighter);
    font-style: italic;
    padding: 0.5rem 1rem;
    background: var(--background);
    border-radius: 16px;
}

/* Grid Container - Modern Flowing Design */
.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem 3rem;
    padding: 2rem 0;
}

.grid-item {
    background: transparent;
    border: none;
    overflow: visible;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Visible state for scroll animations */
.grid-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger grid animation delays */
.grid-item:nth-child(3n+1) { transition-delay: 0s; }
.grid-item:nth-child(3n+2) { transition-delay: 0.1s; }
.grid-item:nth-child(3n+3) { transition-delay: 0.2s; }

/* Image container with hover effects */
.grid-item-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-item:hover .grid-item-image-container {
    transform: scale(1.03);
}

.grid-item-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-item:hover .grid-item-image {
    transform: scale(1.08);
}

/* Gradient overlay on grid images */
.grid-item-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

.grid-item-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.grid-item-image.placeholder.memory {
    background: linear-gradient(135deg, var(--color-memory) 0%, var(--pink-lavender) 100%);
}

.grid-item-image.placeholder.first {
    background: linear-gradient(135deg, var(--color-first) 0%, var(--pink-lavender) 100%);
}

.grid-item-image.placeholder.milestone {
    background: linear-gradient(135deg, var(--color-milestone) 0%, var(--flax) 100%);
}

.grid-item-image.placeholder.event {
    background: linear-gradient(135deg, var(--color-event) 0%, var(--champagne-pink) 100%);
}

.grid-item-content {
    padding: 0;
}

.grid-item-date {
    color: var(--text-lighter);
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    opacity: 0.7;
}

.recurring-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
    background: transparent;
    color: var(--lavender-floral);
    border: 1px solid var(--lavender-floral);
    border-radius: 12px;
    text-transform: none;
    font-weight: 500;
    letter-spacing: 0;
    opacity: 0.8;
}

.grid-item.auto-generated {
    opacity: 0.9;
}

.grid-item.auto-generated .grid-item-image-container {
    opacity: 0.95;
}

.grid-item-title {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.grid-item:hover .grid-item-title {
    color: var(--lavender-floral);
}

.grid-item-description {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 300;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-item-actions {
    display: flex;
    gap: 0.5rem;
}

.grid-item-actions .post-btn {
    width: 32px;
    height: 32px;
    padding: 0;
}

/* Add Button - Modern Flowing Design */
.add-btn {
    background: transparent;
    color: var(--lavender-floral);
    border: 1px solid var(--lavender-floral);
    padding: 0.9rem 2.25rem;
    border-radius: 40px;
    font-size: 0.875rem;
    font-weight: 300;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.add-btn:hover {
    background: var(--lavender-floral);
    color: white;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(180, 145, 222, 0.25);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal.active,
.modal[style*="display: block"],
.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-content {
    background-color: white;
    padding: 0;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

/* Fixed modal header */
.modal-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 25px 32px 20px 32px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    border-radius: 16px 16px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-dark);
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-delete-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-light);
}

.modal-delete-btn:hover {
    background: #fee;
    border-color: #dc3545;
    color: #dc3545;
}

/* Scrollable form content */
#postForm {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@media (max-width: 768px) {
    .modal-header {
        padding: 20px 24px 16px 24px;
    }

    #postForm {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        margin: 0 10px;
    }

    .modal-header {
        padding: 16px 20px 12px 20px;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    #postForm {
        padding: 20px;
    }

    .modal-delete-btn {
        width: 32px;
        height: 32px;
    }

    .modal-delete-btn svg {
        width: 18px;
        height: 18px;
    }
}

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

.close {
    color: var(--text-light);
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
    background: transparent;
    border: none;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover {
    color: var(--text-dark);
}

@media (max-width: 480px) {
    .modal-content h2 {
        font-size: 1.3rem;
        margin-bottom: 1.2rem;
    }
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    font-family: 'Lato', sans-serif;
    font-size: 0.875rem;
    letter-spacing: 0;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 400;
    transition: all 0.2s ease;
    background: white;
}

.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 400;
    transition: all 0.2s ease;
    background: white;
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-group input[type="text"]:hover,
.form-group input[type="date"]:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #c0c0c0;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--lavender-floral);
    background: white;
    box-shadow: 0 0 0 3px rgba(180, 145, 222, 0.1);
}

/* Direct form-input class for modal inputs */
.form-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 300;
    transition: all 0.2s ease;
    background: var(--background);
    min-height: 44px;
}

.form-input:focus {
    outline: none;
    border-color: var(--lavender-floral);
    background: white;
    box-shadow: 0 0 0 4px rgba(180, 145, 222, 0.1);
}

/* Add List Modal */
.add-list-modal-content {
    max-width: 450px;
    padding: 32px !important;
    border-radius: 16px;
}

.add-list-modal-content .close {
    position: sticky;
    top: 0;
    align-self: flex-end;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    z-index: 10;
    margin-bottom: -10px;
}

.add-list-modal-content .close:hover {
    color: var(--text-dark);
}

.add-list-modal-content h2 {
    margin: 0 0 24px 0;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-dark);
    padding-right: 30px;
}

.modal-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* Form group spacing in list modal */
.add-list-modal-content .form-group {
    margin-bottom: 16px;
}

/* Modern form inputs for list modal */
.add-list-modal-content .form-input {
    height: 48px;
    padding: 0 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 400;
    transition: all 0.2s ease;
    background: white;
    display: flex;
    align-items: center;
}

.add-list-modal-content .form-input:hover {
    border-color: #c0c0c0;
}

.add-list-modal-content .form-input:focus {
    outline: none;
    border-color: var(--lavender-floral);
    box-shadow: 0 0 0 3px rgba(180, 145, 222, 0.1);
}

/* Modal select with feedback wrapper */
.modal .select-with-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal .select-with-feedback .form-input {
    flex: 1;
}

.save-list-btn {
    width: 100%;
    height: 48px;
    padding: 0 20px;
    background: var(--lavender-floral);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 24px;
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-list-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
    background: var(--rose-pompadour);
}

.save-list-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem;
    background: var(--background);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background: var(--border-light);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--lavender-floral);
}

.checkbox-label span {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-dark);
}

/* Mobile responsive styles for list modal */
@media (max-width: 768px) {
    .add-list-modal-content {
        padding: 24px !important;
    }
}

@media (max-width: 480px) {
    .add-list-modal-content {
        padding: 20px !important;
    }

    .add-list-modal-content h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
}

.form-hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-lighter);
    line-height: 1.5;
    padding-left: 1rem;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 1.5px dashed var(--border-light);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--background);
    font-size: 0.9rem;
    font-weight: 300;
}

.form-group input[type="file"]:hover {
    border-color: var(--lavender-floral);
    background: white;
}

#postPhotoPreview {
    margin-top: 1rem;
    text-align: center;
}

#postPhotoPreview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: var(--shadow-subtle);
}

.photo-preview-container {
    position: relative;
    display: inline-block;
}

.delete-photo-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    color: #e74c3c;
}

.delete-photo-btn:hover {
    background: #e74c3c;
    color: white;
    transform: scale(1.1);
}

.photo-deleted-msg {
    color: #e74c3c;
    font-size: 0.9rem;
    font-style: italic;
    padding: 1rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
    margin: 0;
}

.submit-btn {
    width: 100%;
    background: var(--lavender-floral);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 40px;
    font-size: 0.95rem;
    font-weight: 400;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-medium);
}

.submit-btn:hover {
    background: var(--rose-pompadour);
    box-shadow: var(--shadow-elevated);
    transform: translateY(-2px);
}

/* Field Hints */
.field-hint {
    color: #999;
    font-weight: 300;
    font-size: 0.85rem;
    margin-left: 6px;
}

/* Type Radio Buttons */
.type-radio-group {
    display: flex;
    gap: 6px;
    width: 100%;
}

.type-radio-btn {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.type-radio-btn input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.type-radio-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 12px;
    background: var(--ghost-white);
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #666;
    transition: all 0.2s ease;
}

.type-radio-btn span:hover {
    border-color: #c0c0c0;
    background: white;
}

.type-radio-btn input[type="radio"]:checked + span {
    background: linear-gradient(135deg, rgba(180, 145, 222, 0.1), rgba(234, 125, 158, 0.1));
    border-color: var(--lavender-floral);
    color: var(--lavender-floral);
    font-weight: 500;
}

.type-radio-btn:hover span {
    border-color: #c0c0c0;
}

/* Form Actions (Photo + Save Buttons Row) */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

@media (max-width: 480px) {
    .form-actions {
        gap: 8px;
    }
}

.photo-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 10px;
    background: var(--ghost-white);
    border: 1.5px dashed #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s ease;
}

.photo-btn svg {
    flex-shrink: 0;
}

.photo-btn:hover {
    border-color: var(--lavender-floral);
    background: white;
    color: var(--lavender-floral);
}

.save-btn {
    flex: 1.5;
    background: var(--lavender-floral);
    color: white;
    border: none;
    height: 48px;
    padding: 0 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    justify-content: center;
}

.save-btn:hover:not(:disabled) {
    box-shadow: var(--shadow-elevated);
    transform: translateY(-2px);
    background: var(--rose-pompadour);
}

.save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Homepage Slideshow Checkbox */
.homepage-checkbox-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.homepage-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    min-height: 44px;
    padding: 8px 0;
}

.homepage-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.custom-checkbox {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    border: 2px solid #d0d0d0;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.homepage-checkbox-label:hover .custom-checkbox {
    border-color: var(--lavender-floral);
}

.homepage-checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
    background: var(--lavender-floral);
    border-color: var(--lavender-floral);
}

.homepage-checkbox-label input[type="checkbox"]:checked + .custom-checkbox::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    top: 2px;
}

.checkbox-text {
    font-size: 0.85rem;
    color: #666;
    user-select: none;
}

/* Form Footer Note */
.form-footer-note {
    text-align: center;
    font-size: 0.8rem;
    color: #999;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem 2rem;
    }

    /* Adjust stagger for 2-column layout */
    .grid-item:nth-child(2n+1) { transition-delay: 0s; }
    .grid-item:nth-child(2n+2) { transition-delay: 0.1s; }
    .grid-item:nth-child(3n+1),
    .grid-item:nth-child(3n+2),
    .grid-item:nth-child(3n+3) { transition-delay: inherit; }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0.75rem 2rem;
    }

    .nav-right {
        gap: 1rem;
    }

    .user-profile {
        padding: 0.4rem 0.75rem;
    }

    .user-name {
        max-width: 100px;
        font-size: 0.85rem;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    /* Slightly smaller add event button on tablet */
    .add-event-nav-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .add-event-nav-btn svg {
        width: 18px;
        height: 18px;
    }

    .app-container {
        padding: 20px 15px;
    }

    .page-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .page-header h2 {
        font-size: 2rem;
    }

    .filter-toggles {
        flex-wrap: wrap;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Reset stagger for single column */
    .grid-item:nth-child(n) { transition-delay: 0s; }
    .grid-item:nth-child(2n+1),
    .grid-item:nth-child(2n+2),
    .grid-item:nth-child(3n+1),
    .grid-item:nth-child(3n+2),
    .grid-item:nth-child(3n+3) { transition-delay: inherit; }

    .grid-item-image {
        height: 240px;
    }

    .grid-item-title {
        font-size: 1.35rem;
    }

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

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

    .modal-content {
        width: 95%;
    }

    .login-content {
        padding: 3rem 2rem;
    }

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

    /* Mobile timeline - stacked layout */
    .timeline-posts {
        padding: 1rem 0;
    }

    .season-section {
        padding: 2rem 0;
        margin-bottom: 1rem;
    }

    .timeline-post {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
        padding: 0 5px;
    }

    /* Auto-generated milestones on mobile */
    .timeline-post.auto-generated {
        padding: 10px 16px;
        margin: 15px auto;
    }

    .timeline-post.auto-generated .post-title {
        font-size: 0.9rem;
    }

    .timeline-post.auto-generated .post-type-badge {
        font-size: 0.55rem;
    }

    .timeline-post.auto-generated .post-description {
        font-size: 0.7rem;
    }

    /* Reset order for all posts - image first, then content */
    .timeline-post:nth-child(odd) .post-content,
    .timeline-post:nth-child(even) .post-content {
        order: 2;
    }

    .timeline-post:nth-child(odd) .post-image-container,
    .timeline-post:nth-child(even) .post-image-container {
        order: 1;
    }

    .timeline-post .post-image {
        height: 180px;
    }

    .post-title {
        font-size: 1.4rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .post-description {
        font-size: 0.95rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    .post-type-badge {
        font-size: 0.7rem;
    }

    .post-date {
        font-size: 0.85rem;
    }

    /* Show action buttons on mobile */
    .post-actions {
        opacity: 1;
        gap: 12px;
    }

    .post-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        border: none;
    }

    .post-btn svg {
        width: 16px;
        height: 16px;
    }

    /* Dividers on mobile */
    .event-divider {
        margin: 25px auto;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.65rem 1.5rem;
    }

    .user-name {
        display: none;
    }

    .user-profile {
        padding: 0.4rem;
    }

    .nav-right {
        gap: 0.75rem;
    }

    /* Hide text on mobile, show only icon */
    .add-event-nav-btn .add-event-text {
        display: none;
    }

    .add-event-nav-btn {
        padding: 0.6rem;
        width: 40px;
        height: 40px;
        justify-content: center;
    }

    .add-event-nav-btn svg {
        width: 22px;
        height: 22px;
    }

    .app-container {
        padding: 1.5rem;
    }

    .home-title {
        font-size: 2.5rem;
    }

    .explore-btn {
        font-size: 0.9rem;
        padding: 0.875rem 2rem;
    }

    .upload-photo-btn {
        bottom: 1.5rem;
        right: 1.5rem;
        font-size: 0.8rem;
        padding: 0.65rem 1.25rem;
    }

    .login-content {
        padding: 2.5rem 1.5rem;
    }

    .login-title {
        font-size: 1.75rem;
    }

    .google-signin-btn {
        font-size: 0.9rem;
        padding: 0.875rem 1.5rem;
    }
}

/* ========== PHOTO PREVIEW GRID (Phase 2) ========== */

.photos-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.photo-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
    background: #f5f5f5;
    transition: all 0.2s ease;
}

.photo-preview-item:hover {
    border-color: var(--rose-pompadour);
    box-shadow: 0 4px 12px rgba(235, 112, 147, 0.15);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .delete-photo-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(235, 112, 147, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    z-index: 10;
    opacity: 0;
}

.photo-preview-item:hover .delete-photo-btn {
    opacity: 1;
}

.photo-preview-item .delete-photo-btn:hover {
    background: #d88799;
    transform: scale(1.1);
}

/* Disabled state for Add Photos button */
.photo-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Photo count styling */
#photoCountDisplay {
    font-family: 'Lato', sans-serif;
}

#photoCountDisplay.at-limit {
    color: #e74c3c;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .photos-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .photo-preview-item .delete-photo-btn {
        opacity: 1;
    }
}

/* ========== PHOTO CAROUSEL (Phase 3) ========== */

.carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #FCF9F3; /* Silly & Lagar cream background */
    touch-action: pan-y pinch-zoom; /* Allow vertical scroll, prevent default horizontal */
    transition: height 300ms ease-out;
    min-height: 200px;
    max-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 300ms ease-out;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

/* Phase 4: Natural aspect ratio - DEFAULT TO COVER for all photos */
.carousel-slide img {
    width: 100%;
    height: auto;
    max-height: 500px;
    max-width: 100%;
    object-fit: cover; /* Default: fill container (landscape photos) */
    display: block;
    margin: 0 auto;
}

/* Phase 4: Portrait-specific styling */
.carousel-slide.portrait {
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-slide.portrait img {
    max-height: 500px;
    width: auto;
    max-width: 100%;
    object-fit: contain;  /* Show full image for portrait - no cropping */
}

/* Phase 4: Landscape-specific styling - HYBRID APPROACH */
.carousel-slide.landscape img {
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: cover;  /* Fill container for landscape - no gray space */
    max-height: 500px;
}

/* Carousel indicators (dots) */
.carousel-indicators {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    backdrop-filter: blur(4px);
}

.carousel-indicators .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicators .dot.active {
    background: #eb7093; /* Silly & Lagar pink */
    width: 24px;
    border-radius: 4px;
}

.carousel-indicators .dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.carousel-indicators .dot.active:hover {
    background: #eb7093;
}

/* Photo counter */
.carousel-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 10;
    backdrop-filter: blur(4px);
}

/* Optional arrow buttons for desktop */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: none; /* Hidden by default, show on larger screens */
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow.prev {
    left: 12px;
}

.carousel-arrow.next {
    right: 12px;
}

/* Show arrows on desktop */
@media (min-width: 768px) {
    .carousel-arrow {
        display: flex;
    }
}

/* Phase 4: Mobile responsive aspect ratio adjustments */
@media (max-width: 768px) {
    .carousel-container {
        max-height: 70vh;
    }

    .carousel-slide.portrait img {
        max-height: 70vh;
        max-width: 100%;
    }

    .carousel-slide img {
        max-height: 70vh;
    }
}

/* Grid carousel indicator (for grid views) */
.grid-carousel-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 4px;
}

.grid-carousel-indicator svg {
    width: 12px;
    height: 12px;
}

/* ========== PHOTO LIGHTBOX ========== */

.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 300ms ease-out;
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: rgba(235, 112, 147, 0.9); /* Silly and Lagar pink */
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 10001;
    transition: all 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
}

.lightbox-close:hover {
    background: rgba(235, 112, 147, 1);
    transform: scale(1.1);
}

.lightbox-controls {
    position: fixed;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 10001;
    pointer-events: none;
}

.lightbox-controls button {
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    width: 56px;
    height: 56px;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: all 200ms ease;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
    backdrop-filter: blur(10px);
}

.lightbox-controls button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.lightbox-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.lightbox-controls button:disabled:hover {
    transform: none;
}

.lightbox-counter {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    z-index: 10001;
    backdrop-filter: blur(10px);
    user-select: none;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .lightbox-image {
        max-width: 95vw;
        max-height: 85vh;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 28px;
    }

    .lightbox-controls {
        padding: 0 10px;
    }

    .lightbox-controls button {
        width: 48px;
        height: 48px;
        font-size: 30px;
    }

    .lightbox-counter {
        bottom: 20px;
        font-size: 14px;
        padding: 8px 16px;
    }
}
