/* ============================================
   BASE STYLES
   ============================================ */
html {
    background-color: var(--md-sys-color-primary) !important;
}

body {
    background-color: var(--md-sys-color-primary) !important;
    padding: 2rem;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
}

/* ============================================
   GALLERY CONTENT
   ============================================ */
.galleryContent {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 0;
}

/* ============================================
   GALLERY GRID
   ============================================ */
.galleryGrid {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding-bottom: 6rem;
    column-count: 3;
    column-gap: 1rem;
    break-inside: avoid;
    position: relative;
}

.galleryGrid > img {
    -webkit-column-break-inside: avoid;
    break-inside: avoid-column;
    break-inside: avoid;
    margin-bottom: 1rem;
}

.galleryGrid img {
    display: inline-block;
    width: 100%;
    transition:
        filter 0.3s ease,
        box-shadow 0.3s ease;
}

.galleryGrid img:hover {
    filter: brightness(0.8);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.galleryLoadingOverlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--md-sys-color-primary);
    z-index: 100;
}

.galleryLoadingOverlay .spinner {
    width: 64px;
    height: 64px;
    border: 4px solid var(--md-sys-color-on-secondary);
    border-top-color: var(--md-sys-color-primary-fixed);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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



/* ============================================
   GALLERY ANIMATIONS
   ============================================ */
.galleryItem {
    animation: galleryFlyUp 0.3s var(--std-easing) forwards;
    opacity: 0;
}

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

/* ============================================
   BOTTOM TOOLBAR
   ============================================ */
.bottomToolbar {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    z-index: 1000;
    display: flex;
    width: fit-content;
    padding: 0.5rem;
    background-color: var(--md-sys-color-secondary-container);
    border-radius: 4rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
    transform: translateX(-50%);
    gap: 4px;
}

.bottomToolbar .toolbarButton {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    color: var(--md-sys-color-on-secondary-container);
    background: transparent;
    border: none;
    border-radius: 2rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease-out;
    box-shadow: none;
}

.bottomToolbar .toolbarButton:hover {
    background-color: var(--md-sys-color-secondary);
    color: var(--md-sys-color-on-secondary);
    box-shadow: none;
    transform: none;
}

.bottomToolbar .toolbarButton.active {
    background-color: var(--md-sys-color-primary-fixed);
    color: var(--md-sys-color-on-primary-fixed);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media screen and (max-width: 600px) {
    body {
        padding: 1rem;
    }

    .galleryGrid {
        column-count: 2;
        column-gap: 12px;
        margin-bottom: 6rem;
    }

    .galleryGrid > img {
        margin-bottom: 8px;
    }

    .galleryLoadingOverlay .spinner {
        width: 48px;
        height: 48px;
        border: 3px solid var(--md-sys-color-surface-variant);
        border-top-color: var(--md-sys-color-primary);
    }
}