/* bits/style.css */

:root {
    /* Accent variations - Indigo */
    --accent-base: #6366f1;
    --accent-hover: #818cf8;
    --accent-muted: #a5b4fc;
    --accent-light: #e0e7ff;
    --accent-dark: #4f46e5;
    --accent-darker: #4338ca;
    --accent-darkest: #3730a3;

    /* Gallery Specific */
    --gallery-surface: #1a1a1a;
    --gallery-text-secondary: #999999;
    --gap-size: 20px;
}

body {
    background-color: var(--dark-medium-darkest);
    color: var(--dark-light);
}

/* Layout Containers */
.gallery-container {
    padding: 10px 10px;
}

.gallery-header {
    margin-bottom: 40px;
}

.gallery-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: #fff;
    margin-bottom: 10px;
}

.gallery-meta {
    color: var(--gallery-text-secondary);
    font-family: Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
}

.protected-indicator {
    color: var(--accent-muted);
    font-weight: 500;
    margin-bottom: 10px;
}

.breadcrumb {
    margin-bottom: 20px;
    color: var(--gallery-text-secondary);
    font-size: 1.1rem;
}

.breadcrumb a {
    color: var(--dark-light);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #fff;
}

.breadcrumb-current {
    color: #fff;
    font-weight: 500;
}

/* Photo Grid - Flexbox rows with uniform height */
.masonry-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: flex-start;
}

/* Album Card */
.album-card {
    background: var(--gallery-surface);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 0 0 calc(50% - 2px);
    /* Two columns on mobile */
    max-width: 300px;
    /* Maximum width for album cards */
}

.album-card:hover {
    transform: translateY(-4px);
}

.album-cover {
    width: 100%;
    aspect-ratio: 3/2;
    object-fit: cover;
    background-color: #222;
    display: block;
}

.album-info {
    padding: 10px;
}

.album-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
    display: block;
}

.album-date {
    font-size: 0.75rem;
    color: var(--gallery-text-secondary);
    font-family: Menlo, Monaco, Consolas, monospace;
}

/* Root Category Card - Large, centered text, no icons */
.root-category-card {
    background: transparent;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    transition: opacity 0.2s ease;
    flex: 1 1 auto;
    min-width: 200px;
}

.root-category-card:hover {
    opacity: 0.7;
}

.root-category-title {
    font-size: 3rem;
    font-weight: 300;
    color: #fff;
    text-align: center;
    margin: 0;
}

/* Photo Grid Item */
.photo-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #000;
    height: 150px;
    max-width: 420px;
    /* Fixed height for mobile */
    flex-grow: 1;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Video Items - inherit all photo-item styles and add video-specific */
.video-item .video-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    /* Don't use absolute positioning - let it flow normally like photo images */
}

.video-item:hover .video-poster {
    transform: scale(1.05);
}

.video-placeholder {
    width: 100%;
    height: 100%;
    background-color: #222;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-icon {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.5);
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0.7;
    transition: opacity 0.2s ease, background 0.2s ease;
    pointer-events: none;
    z-index: 2;
}

.video-item:hover .video-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.3);
}

.video-play-icon {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Hidden Photos (Admin View) */
.photo-item.hidden {
    opacity: 0.33;
}

.photo-item.hidden::after {
    content: "👁️";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    opacity: 0.8;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Admin Indicator */
.admin-indicator {
    float: right;
    font-size: 0.85rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.admin-indicator-login {
    opacity: 0.33;
}

.admin-indicator a {
    color: var(--accent-base);
    text-decoration: none;
}

.admin-indicator a:hover {
    color: var(--accent-hover);
}


/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
}

.lightbox-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    display: none;
    z-index: 5;
    position: relative;
}

/* Invisible Navigation Zones */
.nav-zone {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    cursor: pointer;
    z-index: 10;
    /* Debug: background: rgba(255,0,0,0.1); */
}

/* For videos, position nav zones at bottom to avoid blocking video controls */
.lightbox.video-active .nav-zone {
    top: auto;
    bottom: 80px; /* Leave space for video controls at bottom */
    height: calc(100% - 80px);
    z-index: 1; /* Below video element and controls */
}

/* Ensure video element and controls are above nav zones */
.lightbox.video-active .lightbox-video {
    z-index: 15;
    position: relative;
}

/* Make sure video controls are clickable */
.lightbox.video-active .lightbox-video::-webkit-media-controls {
    z-index: 20;
}

.nav-prev {
    left: 0;
    cursor: w-resize;
    /* Hint for left */
}

.nav-next {
    right: 0;
    cursor: e-resize;
    /* Hint for right */
}

/* Info Panel */
.info-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 8px;
    color: #fff;
    max-width: 400px;
    z-index: 20;
    display: none;
    backdrop-filter: blur(10px);
}

.info-panel.visible {
    display: block;
}

.info-panel-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-family: 'Inter', sans-serif;
    font-weight: 100;
    font-size: 2rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.info-panel-close:hover {
    opacity: 1;
}

#info-filename {
    margin-top: 0;
    margin-bottom: 15px;
}

/* Lightbox Hints */
.lightbox-close-hint,
.lightbox-exif-hint {
    position: absolute;
    font-size: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 30;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.lightbox-close-hint {
    top: 20px;
    right: 20px;
    font-family: 'Inter', sans-serif;
    font-weight: 100;
    font-size: 2.5rem;
    letter-spacing: 0.1em;
}

.lightbox-exif-hint {
    bottom: 20px;
    left: 20px;
}

.lightbox:hover .lightbox-close-hint,
.lightbox:hover .lightbox-exif-hint {
    opacity: 0.6;
}

.lightbox-close-hint:hover,
.lightbox-exif-hint:hover {
    opacity: 1;
}

/* Hide close hint when info panel is visible on mobile */
@media (max-width: 599px) {
    .lightbox.info-visible .lightbox-close-hint {
        display: none;
    }
}


.exif-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    font-family: Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.exif-label {
    color: var(--gallery-text-secondary);
}

.download-links {
    border-top: 1px solid #333;
    padding-top: 15px;
    display: flex;
    gap: 15px;
}

/* Shortcut Legend */
.shortcut-legend {
    border-top: 1px solid #333;
    padding-top: 15px;
    margin-top: 15px;
}

.shortcut-legend-title {
    font-size: 0.75rem;
    color: var(--gallery-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    font-weight: 500;
}

.shortcut-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--gallery-text-secondary);
    font-family: Menlo, Monaco, Consolas, monospace;
}

.shortcut-item.admin-shortcut {
    opacity: 0.6;
}

.shortcut-item kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-family: Menlo, Monaco, Consolas, monospace;
    color: #fff;
    min-width: 20px;
    text-align: center;
    display: inline-block;
}

.download-btn {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid #444;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.download-btn:hover {
    background: #333;
    border-color: #666;
}

.share-btn {
    background: transparent;
    cursor: pointer;
    font-family: inherit;
}

.share-btn.success {
    background: var(--accent-base);
    border-color: var(--accent-base);
    color: var(--accent-light);
}

/* Loading State */
.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Responsive - Tablet and up */
@media (min-width: 600px) {
    .masonry-grid {
        gap: 4px;
    }

    .photo-item {
        height: 180px;
        max-width: 320px;
    }

    .gallery-container {
        padding: 20px 10px;
    }

    .album-card {
        flex: 0 0 calc(33.333% - 3px);
        /* Three columns on tablet */
    }

    .root-category-title {
        font-size: 4rem;
    }
}

/* Responsive - Desktop */
@media (min-width: 1024px) {
    .masonry-grid {
        gap: 4px;
    }

    .photo-item {
        height: 200px;
    }

    .gallery-container {
        padding: 20px 10px;
    }

    .album-card {
        flex: 0 0 calc(25% - 4px);
        /* Four columns on desktop */
    }

    .root-category-title {
        font-size: 5rem;
    }
}

/* Responsive - Large Desktop */
@media (min-width: 1440px) {
    .photo-item {
        height: 220px;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--dark-medium);
    color: var(--dark-light);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-left: 4px solid var(--accent-base);
}

.toast.error {
    border-left: 4px solid #ff6b6b;
}

/* People Filter */
.people-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

.people-filter .filter-label {
    color: var(--gallery-text-secondary);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.people-filter .filter-btn {
    background: var(--dark-medium);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--dark-light);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.people-filter .filter-btn:hover {
    background: var(--dark-medium-light);
    border-color: rgba(255, 255, 255, 0.2);
}

.people-filter .filter-btn.active {
    background: var(--accent-base);
    border-color: var(--accent-base);
    color: white;
}

.people-filter .filter-btn-link {
    text-decoration: none;
    margin-left: auto;
}

/* Face Overlay Styles */
.face-overlay-container {
    z-index: 10;
}

.face-overlay {
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.face-overlay:hover {
    border-color: var(--accent-base) !important;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

.face-label {
    pointer-events: none;
    z-index: 11;
}
