/* Material 3 Dark Theme Tokens */
:root {
    --md-sys-color-background: #121212;
    --md-sys-color-on-background: #E3E3E3;
    --md-sys-color-surface: #1E1E1E;
    --md-sys-color-primary: #A8C7FA;
    --border-radius-m: 16px;
    --border-radius-pill: 100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "San Francisco", "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin: 0;
}

/* Top App Bar */
.top-app-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    position: sticky;
    top: 0;
    background-color: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.logo {
    font-weight: 500;
    font-size: 1.25rem;
    letter-spacing: 0.5px;
    color: white;
}

.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--md-sys-color-on-background);
    padding: 8px;
    transition: color 0.2s;
}

.icon-button:hover {
    color: var(--md-sys-color-primary);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 24px 40px;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.1rem;
    color: #A0A0A0;
    margin-bottom: 32px;
    font-weight: 300;
}

/* Filter Chips */
.chip-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.chip {
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-background);
    border: 1px solid #333;
    padding: 8px 16px;
    border-radius: var(--border-radius-pill);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover {
    background-color: #333;
}

.chip.active {
    background-color: var(--md-sys-color-primary);
    color: #000;
    border-color: var(--md-sys-color-primary);
    font-weight: 500;
}

/* Dynamic Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    grid-auto-rows: 250px;
    grid-auto-flow: dense;
    gap: 16px;
    padding: 16px 32px 60px;
    max-width: 1600px;
    margin: 0 auto;
    background-color: #343d46;
    border-radius: var(--border-radius-m);
}

/* Grid Spans for variety */
@media (min-width: 768px) {
    .wide {
        grid-column: span 2;
    }

    .tall {
        grid-row: span 2;
    }
}

.photo-card {
    border-radius: var(--border-radius-m);
    overflow: hidden;
    background-color: var(--md-sys-color-surface);
    cursor: pointer;
    position: relative;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.photo-card:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.lightbox-content {
    display: block;
    max-width: 80vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: zoom 0.3s ease;
    flex-shrink: 0;
}

@keyframes zoom {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 36px;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1000;
}

.close:hover {
    color: var(--md-sys-color-primary);
}

/* Lightbox Navigation Arrows */
.lightbox-nav {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f1f1;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    flex-shrink: 0;
    z-index: 1000;
}

.lightbox-nav:hover {
    background: rgba(168, 199, 250, 0.2);
    color: var(--md-sys-color-primary);
    transform: scale(1.08);
}

.lightbox-nav .material-symbols-outlined {
    font-size: 28px;
}