:root {
    --primary-color: #0a0a0a;
    --secondary-color: #1a1a1a;
    --accent-color: #c9a063;
    --accent-bright: #e6b87e;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #606060;
    --border-color: #2a2a2a;
    --success-color: #27ae60;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.7);
    --glow: 0 0 20px rgba(201, 160, 99, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--primary-color);
    overflow-x: hidden;
}

/* Header */
.header {
    background: rgba(10, 10, 10, 0.95);
    background: var(--primary-color);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.8);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

@supports not (backdrop-filter: blur(10px)) {
    .header {
        background: rgba(10, 10, 10, 0.98);
    }
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.8rem;
    color: var(--accent-color);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 10px rgba(201, 160, 99, 0.3);
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-bright);
    background-color: rgba(201, 160, 99, 0.1);
}

/* Main Container */
.main-container {
    padding-top: 80px; /* Account for fixed header */
    min-height: 100vh;
}

/* Loading */
.loading {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #e74c3c;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-align: center;
    margin: 2rem;
}

/* Gallery Container - Full Screen Vertical Scroll */
.gallery-container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    height: calc(100vh - 80px);
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    .gallery-container {
        scroll-snap-type: none;
        scroll-behavior: auto;
    }
}

/* Wedding Section - Full Screen */
.wedding-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1s ease, transform 1s ease;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    width: 100%;
}

.wedding-section.in-view {
    opacity: 1;
    transform: scale(1);
}

.wedding-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(201, 160, 99, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.wedding-header {
    color: var(--text-primary);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 6rem 2rem 2rem 2rem;
    flex-shrink: 0;
    transition: all 0.4s ease;
    width: 100%;
    box-sizing: border-box;
}

.wedding-header .header-content {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wedding-header .wedding-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    font-weight: 700;
    transition: all 0.4s ease;
    width: 100%;
}

.wedding-header .wedding-details {
    opacity: 1;
    max-height: 200px;
    transition: opacity 0.3s ease, max-height 0.3s ease, margin 0.3s ease;
    overflow: hidden;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wedding-header .date {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.wedding-header .description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Collapsed state - hide details, shrink title */
.wedding-section[data-state="collapsed"] .wedding-header {
    padding: 1rem 2rem 0.5rem 2rem;
    align-items: flex-start;
}

.wedding-section[data-state="collapsed"] .wedding-header .wedding-title {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.wedding-section[data-state="collapsed"] .wedding-header .header-content {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    text-align: left;
    align-items: flex-start;
}

.wedding-section[data-state="collapsed"] .wedding-header .wedding-details {
    opacity: 0;
    max-height: 0;
    margin: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    pointer-events: none;
    visibility: hidden;
}

.wedding-section[data-state="collapsed"] .media-grid {
    padding-top: 1rem;
}

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

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

@media (prefers-reduced-motion: reduce) {
    @keyframes fadeInDown {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
    
    .wedding-section {
        transition: opacity 0.3s ease;
    }
    
    .album-card {
        transition: box-shadow 0.3s ease;
    }
    
    .scroll-indicator {
        animation: none;
    }
}

.wedding-header h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 4px 20px rgba(201, 160, 99, 0.3);
}

.wedding-header .date {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.wedding-header .description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 300;
}

/* Albums Container - Horizontal Scroll Carousel */
.albums-container {
    width: 100%;
    max-width: 1400px;
    z-index: 2;
}

.albums-scroll {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 2rem 2rem 3rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--border-color);
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

@media (prefers-reduced-motion: reduce) {
    .albums-scroll {
        scroll-snap-type: none;
        scroll-behavior: auto;
    }
}

.albums-scroll::-webkit-scrollbar {
    height: 10px;
}

.albums-scroll::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 5px;
}

.albums-scroll::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 5px;
    transition: background 0.3s;
}

.albums-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--accent-bright);
}

/* Album Card - Dramatic Style */
.album-card {
    flex: 0 0 400px;
    background: rgba(26, 26, 26, 0.8);
    background: var(--secondary-color);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    scroll-snap-align: center;
    position: relative;
}

@supports not (backdrop-filter: blur(10px)) {
    .album-card {
        background: rgba(26, 26, 26, 0.95);
    }
}

.album-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--accent-color), transparent, var(--accent-bright));
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.album-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: var(--glow), var(--shadow-hover);
}

.album-card:hover::before {
    opacity: 1;
}

.album-card h3 {
    padding: 1.5rem;
    background: rgba(201, 160, 99, 0.1);
    color: var(--accent-bright);
    font-size: 1.4rem;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-color);
    letter-spacing: 0.5px;
}

.album-description {
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.album-media-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    aspect-ratio: 3 / 2;
    background: var(--border-color);
}

.album-media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.album-card:hover .album-media-preview img {
    transform: scale(1.1);
}

.album-media-count {
    padding: 1rem 1.5rem;
    background: rgba(10, 10, 10, 0.6);
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-align: center;
    font-weight: 500;
}

/* Media Modal - Dramatic Dark Style */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

@supports not (backdrop-filter: blur(10px)) {
    .modal {
        background: rgba(0, 0, 0, 0.99);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: block;
}

.modal-content {
    position: relative;
    margin: 2rem auto;
    max-width: 1400px;
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-size: 2rem;
    color: var(--accent-bright);
    font-weight: 600;
}

.modal-close {
    background: rgba(201, 160, 99, 0.1);
    border: 2px solid var(--accent-color);
    color: var(--accent-bright);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(201, 160, 99, 0.3);
    transform: rotate(90deg);
    box-shadow: var(--glow);
}

/* Media Grid - Horizontal Scroll */
.media-grid {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0 4rem 5rem 4rem;
    scroll-snap-type: x proximity;
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
}

.media-grid::-webkit-scrollbar {
    height: 8px;
}

.media-grid::-webkit-scrollbar-track {
    background: var(--secondary-color);
    border-radius: 4px;
}

.media-grid::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

.media-item {
    flex: 0 0 auto;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, width 0.3s ease;
    scroll-snap-align: start;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
}

.media-item:hover {
    transform: scale(1.02);
    box-shadow: var(--glow);
}

.media-item img,
.media-item video {
    height: 100%;
    width: auto;
    display: block;
    object-fit: contain;
}

.media-item video {
    cursor: pointer;
}

/* Footer */
.footer {
    background: var(--primary-color);
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    animation: bounce 2s infinite;
    z-index: 10;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
    fill: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        padding: 0.75rem 1rem;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .nav {
        gap: 0.75rem;
    }

    .nav-link {
        padding: 0.4rem 0.75rem;
        font-size: 0.9rem;
    }

    .main-container {
        padding-top: 120px;
    }

    .gallery-container {
        height: calc(100vh - 120px);
    }

    .wedding-section {
        min-height: calc(100vh - 120px);
        padding: 1rem;
    }

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

    .wedding-header .date {
        font-size: 0.9rem;
    }

    .wedding-header .description {
        font-size: 0.95rem;
    }

    .album-card {
        flex: 0 0 300px;
    }

    .album-card h3 {
        font-size: 1.2rem;
        padding: 1rem;
    }

    .media-item {
        width: 300px;
        height: 500px;
    }

    .modal-content {
        padding: 1rem;
    }

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

/* PhotoPrism Link Icon */
.photoprism-link-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: var(--shadow);
}

/* Progressive Image Loading */
.img-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skeleton-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--secondary-color) 25%, var(--border-color) 50%, var(--secondary-color) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-loader.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.lazy-image {
    height: 100%;
    width: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Fullscreen Photo Viewer */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fullscreen-overlay.active {
    opacity: 1;
}

.fullscreen-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.1);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: fit-content;
    height: fit-content;
    max-width: 95vw;
    max-height: 95vh;
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease;
}

.fullscreen-modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.fullscreen-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 44px;
    height: 44px;
    border: 2px solid var(--accent-color);
    background: rgba(0, 0, 0, 0.7);
    color: var(--accent-bright);
    font-size: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2003;
    line-height: 1;
    padding-bottom: 4px;
}

.fullscreen-close:hover {
    background: rgba(201, 160, 99, 0.3);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(201, 160, 99, 0.5);
}

.fullscreen-img-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 
        0 0 60px 20px rgba(201, 160, 99, 0.3),
        0 0 100px 40px rgba(201, 160, 99, 0.15),
        0 25px 50px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.4s ease;
}

.fullscreen-img-container.loaded {
    box-shadow: 
        0 0 80px 30px rgba(201, 160, 99, 0.4),
        0 0 120px 50px rgba(201, 160, 99, 0.2),
        0 30px 60px rgba(0, 0, 0, 0.6);
}

.fullscreen-image {
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform-origin: center center;
    cursor: default;
    border-radius: 12px;
}

.fullscreen-image.loaded {
    opacity: 1;
    transform: scale(1);
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    z-index: 2003;
}

.zoom-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--accent-color);
    background: rgba(201, 160, 99, 0.1);
    color: var(--accent-bright);
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.zoom-btn:hover {
    background: rgba(201, 160, 99, 0.3);
    transform: scale(1.1);
}

.zoom-btn.zoom-reset {
    font-size: 18px;
}

/* Responsive adjustments for fullscreen viewer */
@media (max-width: 768px) {
    .fullscreen-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .fullscreen-image {
        max-width: 100vw;
        max-height: 85vh;
    }
    
    .zoom-controls {
        bottom: 15px;
        padding: 6px 12px;
    }
    
    .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    
    .fullscreen-img-container {
        box-shadow: 
            0 0 40px 15px rgba(201, 160, 99, 0.3),
            0 0 80px 30px rgba(201, 160, 99, 0.15),
            0 20px 40px rgba(0, 0, 0, 0.5);
    }
}

/* Prevent page scroll when fullscreen modal is open */
body.modal-open {
    overflow: hidden;
}
