/* CSS Variables for Design System */
:root {
    /* Colors */
    --gallery-background: hsl(fff, 47%, 11%);
    --gallery-card: hsl(221, 39%, 18%);
    --gallery-header-text: #d90176;
    --gallery-text: #fff;
    --gallery-text-muted: #0f3661;
    --gallery-accent: #d90176;
    --gallery-accent-hover: #0f3661;
    
    /* Shadows */
    --shadow-elegant: 0 10px 30px -10px hsla(262, 83%, 58%, 0.3);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gallery-background);
    color: var(--gallery-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Header Styles */
/*
.header {
    padding: 4rem 1.5rem;
    text-align: center;
    background: linear-gradient(to bottom, var(--gallery-card), var(--gallery-background));
    position: relative;
}

.header-content {
    max-width: 64rem;
    margin: 0 auto;
}

.header-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--gallery-header-text);
    animation: fadeIn 0.6s ease-out;
}

.header-subtitle {
    font-size: 1.25rem;
    color: var(--gallery-text-muted);
    animation: fadeIn 0.6s ease-out 0.2s both;
}
*/
/* Navigation Tabs */
.nav-tabs {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(var(--gallery-background), 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--gallery-card);
}

.tabs-container {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: transparent;
    color: var(--gallery-text-muted);
    font-size: 1rem;
}

.tab-button:hover {
    color: var(--gallery-text);
    background-color: var(--gallery-card);
}

.tab-button.active {
    background-color: var(--gallery-accent);
    color: var(--gallery-background);
    box-shadow: var(--shadow-elegant);
    transform: scale(1.05);
}

/* Gallery Main */
.gallery-main {
    max-width: 88rem;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .photo-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Photo Card */
.photo-card {
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: var(--gallery-card);
    transition: var(--transition-smooth);
    animation: fadeInScale 0.6s ease-out both;
}

.photo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elegant);
}

.photo-container {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.photo-card:hover .photo-image {
    transform: scale(1.1);
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: var(--transition-smooth);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

.photo-info h3 {
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.photo-info p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    max-width: 80rem;
    max-height: 90vh;
    background-color: var(--gallery-card);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: scale(0.95);
    transition: var(--transition-smooth);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.nav-button:hover {
    background: rgba(0, 0, 0, 0.7);
}

.nav-prev {
    left: 1rem;
}

.nav-next {
    right: 1rem;
}

.modal-image-container {
    position: relative;
}

.modal-image {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    display: block;
}

.modal-details {
    padding: 1.5rem;
    background-color: var(--gallery-card);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gallery-text);
    margin-bottom: 0.5rem;
}

.modal-description {
    color: var(--gallery-text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.modal-year {
    font-size: 0.875rem;
    color: var(--gallery-accent);
    font-weight: 500;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-title {
        font-size: 2.5rem;
    }
    
    .header-subtitle {
        font-size: 1.125rem;
    }
    
    .gallery-main {
        padding: 2rem 1rem;
    }
    
    .photo-grid {
        gap: 1rem;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: 95vh;
    }
    
    .nav-button {
        width: 2rem;
        height: 2rem;
        font-size: 1.25rem;
    }
    
    .modal-close {
        width: 2rem;
        height: 2rem;
        font-size: 1.25rem;
    }
}

/* Focus styles for accessibility */
.tab-button:focus,
.photo-card:focus,
.modal-close:focus,
.nav-button:focus {
    outline: 2px solid var(--gallery-accent);
    outline-offset: 2px;
}

/* Loading state */
.photo-image {
    background-color: var(--gallery-card);
}

.photo-image:not([src]) {
    opacity: 0;
}