/* ============================================
   WEDDING WEBSITE - FAISAL & AFREEN
   ============================================ */

:root {
    /* Refined Color Palette */
    --white: #FFFFFF;
    --off-white: #FAFAFA;
    --cream: #F7F5F3;
    --warm-gray: #E8E4E0;
    --taupe: #A69B8D;
    --charcoal: #1A1A1A;
    --charcoal-light: #2D2D2D;
    --accent: #C9A962;
    --accent-light: #D4B978;
    
    /* Typography */
    --font-display: 'Cormorant', serif;
    --font-body: 'Jost', sans-serif;
    
    /* Spacing */
    --section-padding: clamp(3rem, 8vw, 6rem);
    --grid-gap: 8px;
    --radius: 12px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--charcoal);
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.home-page {
    background-color: var(--charcoal);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   WARNING BAR
   ============================================ */
.warning-bar {
    position: relative;
    width: 100%;
    padding: 0.6rem 0;
    background: linear-gradient(90deg, #8B0000 0%, #B22222 50%, #8B0000 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    overflow: hidden;
}

.warning-bar .marquee {
    display: flex;
    animation: marquee 20s linear infinite;
    white-space: nowrap;
}

.warning-bar .marquee span {
    padding: 0 3rem;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (max-width: 768px) {
    .warning-bar {
        font-size: 0.65rem;
        padding: 0.35rem 0;
    }
    
    .warning-bar .marquee span {
        padding: 0 2rem;
    }
}


/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.7) 80%
    );
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 2rem;
    color: var(--white);
    max-width: 800px;
}

.prelude {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 1.5rem;
    animation: fadeIn 1s ease-out 0.2s both;
}

.couple-names {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.name {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.02em;
    line-height: 1.1;
    animation: nameReveal 1s ease-out both;
}

.name:first-child {
    animation-delay: 0.4s;
}

.name:last-child {
    animation-delay: 0.7s;
}

.ampersand {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-style: italic;
    color: var(--accent);
    opacity: 0.9;
    animation: fadeIn 0.8s ease-out 0.6s both;
}

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

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

/* ============================================
   GALLERY BUTTONS
   ============================================ */
.gallery-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 1s ease-out 1s both;
}

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

.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--white);
    color: var(--charcoal);
    backdrop-filter: none;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--charcoal);
    color: var(--white);
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-initials {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-style: italic;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

/* ============================================
   GALLERY PAGE STYLES - BENTO LAYOUT
   ============================================ */
.gallery-page {
    background: var(--charcoal);
    min-height: 100vh;
}

.gallery-header {
    display: none;
}

/* ============================================
   BENTO GALLERY GRID
   ============================================ */
.gallery-container {
    padding: var(--grid-gap);
    max-width: 1600px;
    margin: 0 auto;
    min-height: 100vh;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--grid-gap);
}

/* Header Card - Full Width */
.gallery-header-card {
    grid-column: 1 / -1;
    background: linear-gradient(145deg, var(--charcoal-light) 0%, #111 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.header-card-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    font-style: italic;
    color: var(--white);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.header-card-subtitle {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.header-card-text {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.header-card-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: transparent;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-card-btn:hover {
    background: var(--accent);
    color: var(--charcoal);
}

/* Gallery Items - Uniform Size */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--charcoal-light);
    aspect-ratio: 4 / 3;
}

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

.gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    z-index: 1;
    pointer-events: none;
    border-radius: var(--radius);
}

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

.gallery-item:hover::before {
    background: rgba(0, 0, 0, 0.15);
}

/* ============================================
   GALLERY FOOTER
   ============================================ */
.gallery-footer {
    padding: 2rem;
    text-align: center;
    background: var(--charcoal);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: transparent;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--white);
    border-color: var(--white);
    color: var(--charcoal);
}

.nav-link .arrow {
    transition: transform 0.3s ease;
}

.nav-link:hover .arrow {
    transform: translateX(3px);
}

/* ============================================
   SPOTLIGHT.JS CUSTOMIZATION
   ============================================ */
.spotlight {
    cursor: pointer;
}

.spl-header,
.spl-title,
.spl-footer,
.spl-page {
    font-family: var(--font-body) !important;
}

.spl-title {
    font-size: 0.85rem !important;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ============================================
   LOADING ANIMATION
   ============================================ */
.gallery-item.loading {
    background: linear-gradient(
        90deg,
        var(--charcoal-light) 0%,
        #333 50%,
        var(--charcoal-light) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    min-height: 200px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    margin-bottom: 1rem;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(.disabled):not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--white);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--charcoal);
    font-weight: 500;
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-prev,
.page-next {
    padding: 0 1rem;
}

.page-dots {
    color: rgba(255, 255, 255, 0.3);
    padding: 0 0.25rem;
}

.page-info {
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.5rem;
}

/* Image count in header */
.header-card-count {
    font-family: var(--font-body);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.header-card-progress {
    font-family: var(--font-body);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .couple-names {
        gap: 0.5rem;
    }
    
    .gallery-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .btn {
        width: 100%;
        max-width: 260px;
        text-align: center;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-header-card {
        padding: 1.5rem;
    }
    
    :root {
        --grid-gap: 6px;
        --radius: 8px;
    }
    
    /* Pagination mobile */
    .pagination {
        gap: 0.35rem;
    }
    
    .page-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.7rem;
    }
    
    .page-prev,
    .page-next {
        padding: 0 0.75rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .prelude {
        font-size: 0.65rem;
        letter-spacing: 0.25em;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.7rem;
    }
    
    .gallery-container {
        padding: 4px;
    }
    
    :root {
        --grid-gap: 4px;
        --radius: 6px;
    }
    
    .header-card-title {
        font-size: 1.75rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.btn:focus-visible,
.gallery-item:focus-visible,
.nav-link:focus-visible,
.header-card-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ============================================
   BOTTOM NAVIGATION - Compact Horizontal
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
}

.nav-icon {
    font-size: 1rem;
    line-height: 1;
}

.nav-label {
    font-size: 0.85rem;
    text-transform: none;
}

.saved-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: 600;
    background: #ff4757;
    color: white;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
}

/* Add padding to gallery for bottom nav */
.gallery-page .gallery-container {
    padding-bottom: 70px;
}

/* ============================================
   SAVE BUTTON ON IMAGES
   ============================================ */
.save-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 1;
    transition: all 0.2s ease;
}

.save-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.save-btn.saved {
    color: #ff4757;
}

/* Remove button on saved page - always visible */
.remove-saved-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 1;
    transition: all 0.2s ease;
}

.remove-saved-btn:hover {
    background: #ff4757;
    transform: scale(1.1);
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 200;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   SAVED PAGE STYLES
   ============================================ */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.4);
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.empty-hint {
    font-size: 0.8rem !important;
    opacity: 0.6;
}

/* Subtle copy link */
.copy-link {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.copy-link:hover {
    color: rgba(255, 255, 255, 0.6);
}

.clear-btn {
    font-size: 0.65rem !important;
    padding: 0.5rem 1rem !important;
    opacity: 0.5;
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.clear-btn:hover {
    opacity: 1 !important;
    background: #ff4757 !important;
    border-color: #ff4757 !important;
}

/* ============================================
   SAVED PAGE HEADER CARD ADDITIONS
   ============================================ */
.home-btn {
    margin-top: 1rem;
}

/* ============================================
   DESKTOP NAV ADJUSTMENTS
   ============================================ */
@media (min-width: 769px) {
    .bottom-nav {
        position: sticky;
        bottom: 0;
        top: auto;
        padding: 1rem 2rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        border-bottom: none;
    }
    
    .nav-item {
        padding: 0.75rem 2rem;
        font-size: 0.95rem;
    }
    
    .gallery-page .gallery-container {
        padding-top: 1rem;
        padding-bottom: 2rem;
    }
    
    .toast {
        bottom: 100px;
    }
}

/* ============================================
   CUSTOM LIGHTBOX
   ============================================ */
.custom-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.custom-lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
}

.lightbox-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-img-container {
    width: 90vw;
    height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-img.loaded {
    opacity: 1;
}

/* Loading spinner */
.lightbox-spinner {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.lightbox-spinner.hidden {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.lightbox-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.lightbox-download {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--accent);
    color: #000;
}

.lightbox-download:hover {
    background: var(--accent-light);
}

.lightbox-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}
