:root {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gallery-gap:0.65rem;
    --radius: 12px;
    /* Theme helpers — override in [data-theme] blocks */
    --header-bg: #0b1221;
    --footer-bg: #0b1221;
    --border-color: #334155;
    --border-subtle: rgba(255,255,255,0.06);
    --skeleton-from: #1e293b;
    --skeleton-mid: #263248;
    --slider-bg: #2c3545;
    --card-hover-bg: #1a2844;
    --surface-input: var(--bg-color);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    padding: 1rem;
}
@media (min-width: 640px) { body { padding: 1.5rem 1.5rem 0 1.5rem; } }
@media (min-width: 1024px) { body { padding: 1rem 1rem 0 1rem; } }


/* Header & Controls */
header {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--surface-color);

    background: var(--header-bg);
    margin: -15px -15px 15px -15px;
    padding: 0px 15px 1rem 15px;

    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0px 0px 10px black;
}

/* Row 1: logo left, slogan right */
.header-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
}
.header-top.modal {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 15px;
    align-items: center;
    flex-direction: column;
} 
.modalclose{
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 8px;
    padding: 0.38rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    width: 100%;
    text-align:center;
}
.header-brand h1 { font-size: clamp(1.1rem, 4vw, 1.8rem); }
.header-slogan {
    text-align: right;
    flex-shrink: 0;
    max-width: 55%;
}
.header-slogan p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.header-top.modal .header-slogan{
    text-align: left;
    max-width: 100%;
}
/* Row 2: full-width toolbar */
.header-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-subtle);
}

header h1 { font-size: clamp(1.1rem, 4vw, 1.8rem); }
header p  { font-size: 0.85rem; margin-top: 0.3rem; color: var(--text-muted); }
.mainlogo {
    vertical-align: middle;
    margin-right: 20px;
    max-height:60px;
}
header .header-top.min{
    padding-bottom: 0.4rem;
}
header .header-top.min h1 {
    font-size: 1rem;
}
header .header-top.min h1 .mainlogo {
    max-height: 40px;
    margin-right: 12px;
}
header .header-top.min p {
    font-size: 1rem;
}
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.controls.right {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.break, .break2 {
    flex-basis: auto;
    height: auto;
}
@media (max-width: 950px) { 
    .break {
        flex-basis: 100%;
        height: 0;
    }
    .controls.right {
        flex-wrap: nowrap;
        gap: 0.6rem;
        align-items: center;
        padding-top: 0;
        background: none;
    }
}
@media (max-width: 660px) {
    .break2 {
        flex-basis: 100%;
        height: 0;
    }
    
}
@media (max-width: 640px) { 
    .controls.right {
        display: flex;
        /*flex-wrap: wrap;
        gap: 0.4rem;
        align-items: center;
        padding-top:20px;
        background:#2c2c2c;*/
    }
}
.controls button {
    background: var(--surface-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    margin-left: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}
@media (min-width: 640px) {
    .controls button { padding: 0.5rem 1rem; font-size: 1rem; gap: 0.5rem; }
}

.controls button.active, .controls button:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* Size slider */
.size-slider-wrap {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0 0.2rem;
}
.size-slider-wrap svg {
    width: 18px;
    height: 18px;
    stroke: white;
    fill: none;
    stroke-width: 1.5;
    flex-shrink: 0;
    opacity: 1;
}
#size-slider {
    -webkit-appearance: none; appearance: none;
    width: 80px; height: 4px;
    background: var(--slider-bg);
    border-radius: 2px; outline: none; cursor: pointer;
}
#size-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent); cursor: pointer;
}
#size-slider::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--accent); cursor: pointer; border: none;
}

/* Hover Effect Picker */
.sort-wrap {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0 0.2rem;
}
.sort-wrap svg {
    width: 18px; height: 18px;
    stroke: white; fill: none; stroke-width: 1.5;
    flex-shrink: 0;
}
.sort-wrap .select-wrap {
    position: relative; display: flex; align-items: center;
}
.sort-wrap .select-wrap::after {
    content: '';
    position: absolute; right: 7px; top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-top: 5px solid var(--text-muted);
    border-bottom: none;
    pointer-events: none;
}
#sort-select {
    -webkit-appearance: none; appearance: none;
    background: var(--surface-color);
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.78rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
#sort-select:hover { border-color: rgba(255,255,255,0.25); }
#sort-select:focus { border-color: var(--accent); }

.hover-effect-wrap {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0 0.2rem;
}
.hover-effect-wrap svg {
    width: 18px;
    height: 18px;
    stroke: white;
    fill: none;
    stroke-width: 1.5;
    flex-shrink: 0;
    opacity: 1;
}
.hover-effect-wrap .select-wrap {
    position: relative; display: flex; align-items: center;
}
.hover-effect-wrap .select-wrap::after {
    content: '';
    position: absolute; right: 7px; top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-top: 5px solid var(--text-muted);
    border-bottom: none;
    pointer-events: none;
}
#hover-effect-select {
    -webkit-appearance: none; appearance: none;
    background: var(--surface-color);
    color: var(--text-main);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    /*padding: 0.25rem 1.6rem 0.25rem 0.55rem;*/
    padding: 10px;
    font-size: 0.78rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}
#hover-effect-select:hover  { border-color: rgba(255,255,255,0.25); }
#hover-effect-select:focus  { border-color: var(--accent); }

/* =============================================
   HOVER EFFECTS  (class on <body>)
   Default (no extra class) = zoom
   ============================================= */

/* --- zoom (default / no class) --- */
.image-card:hover img { transform: scale(1.07); }

/* --- pan: slides up slightly --- */
body.hover-pan .image-card:hover img {
    transform: scale(1.1) translateY(-4%);
}

/* --- grayscale: desaturated → full colour on hover --- */
body.hover-grayscale .image-card img {
    filter: grayscale(100%) brightness(0.85);
}
body.hover-grayscale .image-card:hover img {
    transform: scale(1.04);
    filter: grayscale(0%) brightness(1);
}

/* --- tilt: subtle 3-D perspective tilt --- */
body.hover-tilt .image-card {
    perspective: 600px;
    perspective-origin: center center;
}
body.hover-tilt .image-card img {
    transform-style: preserve-3d;
}
body.hover-tilt .image-card:hover img {
    transform: rotateY(8deg) scale(1.04);
}

/* --- flash: brightness burst --- */
@keyframes card-flash {
    0%   { filter: brightness(1); }
    25%  { filter: brightness(1.8); }
    100% { filter: brightness(1); }
}
body.hover-flash .image-card:hover img {
    transform: none;
    animation: card-flash 0.45s ease forwards;
}

/* --- none --- */
body.hover-none .image-card:hover img { transform: none; }

/* Gallery Layouts */
.gallery { width: 100%; transition: var(--transition); 
min-height: 50vh;
}

/* Masonry Layout */
.gallery.view-masonry {
    column-width: var(--gallery-size, 200px);
    column-gap: var(--gallery-gap);
}

.gallery.view-masonry .image-card {
    break-inside: avoid;
    margin-bottom: var(--gallery-gap);
    display: inline-block;
    width: 100%;
}

/* Grid Layout */
.gallery.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--gallery-size, 200px), 100%), 1fr));
    gap: var(--gallery-gap);
}
@media (min-width: 480px)  { .gallery.view-grid { gap: 0.5rem; } }
@media (min-width: 768px)  { .gallery.view-grid { gap: var(--gallery-gap); } }
.gallery.view-grid .image-card {
    aspect-ratio: 1 / 1;
}
.gallery.view-grid .image-card img {
    height: 100%;
    object-fit: cover;
}
#gallerytotal{
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
    flex: 1;
}
#gallerymode{
    color:var(--text-muted);
}
/* List Layout */
.gallery.view-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.gallery.view-list .card-video-badge{
    left: calc(var(--gallery-size, 100px) * 0.3);
}
.gallery.view-list .image-card {
    display: flex;
    flex-direction: row;
    height: calc(var(--gallery-size, 200px) * 0.4);
}
.gallery.view-list .image-card img {
    width: calc(var(--gallery-size, 200px) * 0.6);
    height: calc(var(--gallery-size, 200px) * 0.4);
    object-fit: cover;
    flex-shrink: 0;
    border-radius: var(--radius) 0 0 var(--radius);
    transition: none;
}
.gallery.view-list .image-card:hover img { transform: none; }
.gallery.view-list .image-overlay {
    position: static;
    opacity: 1;
    background: none;
    padding: 0 1.2rem;
    flex: 1;
    align-items: center;
}
.gallery.view-list .image-overlay .meta {
    color: var(--text-muted);
    text-shadow: none;
}
.gallery.view-list .image-overlay .meta div:first-child {
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

/* Carousel Layout */
.gallery.view-carousel {
    display: flex;
    overflow-x: auto;
    gap: var(--gallery-gap);
    scroll-snap-type: x mandatory;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    /* Hide scrollbar on all browsers */
    scrollbar-width: none;
    scroll-behavior: smooth;
}
.gallery.view-carousel::-webkit-scrollbar {
    display: none;
}
.gallery.view-carousel .image-card {
    flex: 0 0 min(70vw, 550px);
    height: 65vh;
    scroll-snap-align: start;
}
.gallery.view-carousel .image-card img {
    height: 100%;
    object-fit: cover;
}

/* Carousel navigation buttons */
.carousel-nav {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0 0.5rem;
}
.carousel-nav.visible {
    display: flex;
}
.carousel-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.carousel-nav button:hover {
    background: var(--accent-color, #555);
    color: #fff;
    transform: scale(1.08);
}
.carousel-nav button svg {
    width: 1.2rem;
    height: 1.2rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Image Cards */
.image-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-color);
    cursor: pointer;
    transform: translateZ(0);
}

.image-card img {
    width: 100%;
    display: block;
    transition: transform 0.45s ease, filter 0.45s ease, opacity 0.4s ease;
}
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.image-card.skeleton {
    min-height: 180px;
    background: linear-gradient(90deg, var(--skeleton-from) 25%, var(--skeleton-mid) 50%, var(--skeleton-from) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    max-width: 100%;
}
.image-card.skeleton img {
    opacity: 0;
}

.image-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    padding: 1.2rem 1rem;
    opacity: 0;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}
.recent-date{
    font-size: 0.8rem;
}
.meta {
    /*display: flex;
    flex-direction: column;
    gap: 0.3rem;*/
    width: 100%;
}
.meta-box{
    display: flex;
    justify-content: space-between;
    width: 100%;    
    gap: 0.3rem;
}
.meta-right {
    font-size: 0.8rem;
    color: lightgray;
    text-align: right;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.image-overlay .meta {
    font-size: 0.8rem;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    /*color: var(--text-muted);*/
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

/* Lightbox full layout on small screens */
.lightbox-content {
    position: relative;
    width: 100%;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 2.5rem; /* side room for nav arrows on mobile */
    height: 100%;
}
@media (min-width: 640px) {
    .lightbox-content {
        max-width: 100vw;
        padding: 0 2rem;
    }
}

#lb-zoom-container {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    /*cursor: zoom-in;*/ 
    cursor: url('scroll3.png'), auto;
    min-height:93vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (min-width: 640px) { #lb-zoom-container { max-height: 95vh; } }
#lb-zoom-container.zoomed {
    cursor: grab;
}
#lb-zoom-container.panning {
    cursor: grabbing;
}
#lb-zoom-container {
    transition: opacity 0.4s ease;
}
#lb-zoom-container.ss-fade {
    opacity: 0;
}

/* Lightbox image preloader spinner */
.lb-spinner {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}
.lb-spinner.active {
    display: flex;
}
.lb-spinner svg {
    width: 52px;
    height: 52px;
    animation: lb-spin 0.9s linear infinite;
    stroke: rgba(255,255,255,0.85);
    filter: drop-shadow(0 0 6px rgba(0,0,0,0.6));
}
.lb-spinner svg circle {
    stroke-dasharray: 80 200;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    animation: lb-dash 1.5s ease-in-out infinite;
}
@keyframes lb-spin {
    100% { transform: rotate(360deg); }
}
@keyframes lb-dash {
    0%   { stroke-dasharray: 1 200; stroke-dashoffset: 0; }
    50%  { stroke-dasharray: 89 200; stroke-dashoffset: -35px; }
    100% { stroke-dasharray: 89 200; stroke-dashoffset: -124px; }
}
.lightbox img {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    width: auto;
    height: auto;
    transform-origin: 0 0;
    user-select: none;
    pointer-events: none;
    will-change: transform;
    transition: opacity 0.2s ease;
}
@media (min-width: 640px) { .lightbox img { max-height: 100vh; } }
.lb-meta {
    margin-top: 0.8rem;
    padding: 0.5rem 1rem;
    background: rgba(255,255,255,0.07);
    border-radius: var(--radius);
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    justify-content: center;
}
.lb-meta span strong {
    display: block;
    color: var(--text-main);
    font-size: 0.9rem;
}
.lb-exif {
    display: none;
    margin-top: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius);
    font-size: 0.8rem;
    color: var(--text-muted);
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.5rem 1.5rem;
    max-width: 100%;
}
.lb-exif span strong {
    display: block;
    color: var(--text-main);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}
.lb-counter {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    letter-spacing: 0.05em;
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 42px; height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    z-index: 10;
}
.lb-nav:hover { background: var(--accent); }
/* On small screens nav arrows sit just inside the image edges */
.lb-prev { left: 4px; }
.lb-next { right: 4px; }
@media (min-width: 640px) {
    .lb-nav { width: 50px; height: 50px; }
    .lb-prev { left: 0; }
    .lb-next { right: 0; }
}

.lb-toolbar {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
@media (min-width: 640px) { .lb-toolbar { gap: 1rem; } }

.lb-btn {
    background: var(--surface-color);
    color: white;
    border: none;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.82rem;
    transition: var(--transition);
    display: flex; align-items: center; gap: 0.4rem;
}
@media (min-width: 640px) { .lb-btn { padding: 0.6rem 1.2rem; font-size: 1rem; gap: 0.5rem; } }
.lb-btn:hover { background: var(--border-color); }
.lb-btn.active { background: var(--accent); color: white; }
.lb-btn.active:hover { background: var(--accent-hover, #2563eb); }
.lb-btn.delete { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.lb-btn.delete:hover { background: var(--danger); color: white; }

.lb-close {
    position: fixed;
    top: 12px; right: 14px;
    background: rgba(0,0,0,0.45);
    border: none;
    border-radius: 50%;
    color: white;
    width: 38px; height: 38px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1010;
    display: flex; align-items: center; justify-content: center;
}
@media (min-width: 640px) {
    .lb-close { top: 20px; right: 24px; width: 44px; height: 44px; font-size: 1.8rem; }
}

/* ---- MOBILE LIGHTBOX ---- */
@media (max-width: 639px) {
    /* Hide nav arrows — swipe handles navigation */
    .lb-nav { display: none; }

    /* Bigger, easier-to-tap close button */
    .lb-close {
        width: 52px; height: 52px;
        font-size: 2rem;
        top: 8px; right: 8px;
    }

    /* Full-screen layout so image gets max space */
    .lightbox-content {
        max-width: 100vw;
        max-height: 100dvh;
        height: 100dvh;
        padding: 0;
        justify-content: space-between;
    }

    /* Image area stretches to fill all available vertical space */
    #lb-zoom-container {
        flex: 1;
        width: 100%;
        max-width: 100vw;
        max-height: none;
        border-radius: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .lightbox img {
        max-height: 100%;
        max-width: 100vw;
        object-fit: contain;
    }

    /* Counter sits at top, compact */
    .lb-counter {
        padding: 0.4rem 0;
        margin-bottom: 0;
    }

    /* Compact meta row */
    .lb-meta {
        margin-top: 0;
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
        gap: 0.4rem 1rem;
    }
    .lb-meta span strong { font-size: 0.78rem; }

    /* Toolbar pinned to bottom, full width */
    .lb-toolbar {
        margin-top: 0;
        padding: 0.4rem 0.5rem;
        width: 100%;
        background: rgba(0,0,0,0.6);
        flex-wrap: nowrap;
        gap: 0.2rem;
        justify-content: space-around;
    }
    .lb-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }
    .lb-btn svg { width: 18px; height: 18px; }
}

/* Tooltip */
#tt {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: #1e293b;
    color: var(--text-main);
    font-size: 0.78rem;
    line-height: 1.4;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    white-space: pre-wrap;
    max-width: 260px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
#tt.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    opacity: 0;
    transition: var(--transition);
    z-index: 2000;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
} 

/* SVG Icons */
svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Admin */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.4);
    color: var(--accent);
    font-size: 0.78rem;
    padding: 0.50rem 0.7rem;
    border-radius: 12px;
    /*margin-left: 0.5rem;*/
}

/* Admin Panel */
#admin-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    right: 0;
}
#admin-panel.open {
    max-height: 100dvh;
    overflow-y: auto;
}
.no-results{
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    column-span: all;
}
.admin-panel__inner {
    background: var(--surface-color);
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 2rem);
    min-height: 50vh;
}
/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 0;
    background: rgba(59,130,246,0.06);
    border-bottom: 1px solid rgba(59,130,246,0.18);
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.admin-tab svg {
    width: 14px; height: 14px;
    stroke: currentColor; fill: none; stroke-width: 1.8;
}
.admin-tab:hover { color: var(--text-main); background: rgba(59,130,246,0.07); }
.admin-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background: rgba(59,130,246,0.1);
}
/* Tab panes */
.admin-tab-pane {
    display: none;
    overflow-y: auto;
    flex: 1;
}
.admin-tab-pane.active { display: block; }
.admin-tab-pane a{
    color:var(--text-main);
    text-decoration: none;
    font-size: 0.82rem;
    flex: 1;
}
.admin-tab-pane a:hover{
    color:var(--text-muted);
}
/* Files tab grid */
.admin-panel__grid--files {
    grid-template-columns: 1fr !important;
}
@media (min-width: 640px) {
    .admin-panel__grid--files { grid-template-columns: 2fr 1fr !important; }
}
.admin-card--upload {
    grid-column: 1;
}
/* Mobile upload shortcut buttons — visible on touch devices, hidden on desktop */
.mobile-upload-btns {
    display: none;
    gap: 0.5rem;
    margin-top: 0.6rem;
}
.mobile-upload-btns .admin-btn {
    flex: 1;
    justify-content: center;
    padding: 0.55rem 0.6rem;
    font-size: 0.82rem;
}
.mobile-upload-btns .admin-btn svg {
    width: 15px; height: 15px;
    stroke: currentColor; fill: none; stroke-width: 1.8;
    flex-shrink: 0;
}
@media (hover: none) and (pointer: coarse) {
    /* Touch/mobile device — show camera+gallery buttons */
    .mobile-upload-btns { display: flex; }
}
.admin-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.2rem;
    background: rgba(59,130,246,0.1);
    border-bottom: 1px solid rgba(59,130,246,0.2);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent);
}
.admin-panel__header > span {
    display: flex; align-items: center; gap: 0.5rem;
}
.admin-panel__header > span svg {
    width: 16px; height: 16px; stroke: var(--accent);
}
.admin-panel__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.2rem;
    transition: color 0.2s;
}
.admin-panel__close:hover { color: var(--text-main); }
.admin-panel__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: var(--surface-color);
}
.mobileshow{
    display:none;
}
@media (min-width: 480px) {
    .admin-panel__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
    .admin-panel__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
    .admin-panel__grid { grid-template-columns: repeat(4, 1fr); }
}
#admin-logs{
    max-height: 0;
    overflow: hidden;
    background: black;
    padding: 0 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: max-height 0.35s ease, padding 0.35s ease;
}
#admin-logs.open{
    max-height: 200px;
    overflow: auto;
    padding: 1rem;
}
.titletoggler{
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-main);
    background: rgba(59, 130, 246, 0.1);
    padding: 5px 10px;
    margin: 0 !important;
    user-select: none;
}
.titletoggler svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    fill: currentColor;
    transition: transform 0.35s ease;
    transform: rotate(180deg);
}
.titletoggler.open svg {
    transform: rotate(0deg);
}
.admin-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.1rem 1.2rem;
    background: var(--surface-color);
    transition: background 0.2s;
    height:auto;
}
.admin-card.big{
    grid-column: 1 / -1;
}
.admin-card.hidden{
    display: none;
    transition:all 0.5s ease-in-out;
    height:0;
}
/*.admin-card:not(.big):hover { background: var(--card-hover-bg); }*/
.admin-card__icon svg {
    width: 28px; height: 28px;
    stroke: var(--accent); fill: none;
    stroke-width: 1.5;
}
.admin-card__body h3 {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.3rem;
}
.admin-card__body p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.admin-card__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-top: 0.4rem;
}
.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(59,130,246,0.12);
    color: var(--accent);
    border: 1px solid rgba(59,130,246,0.35);
    border-radius: 8px;
    padding: 0.38rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.admin-btn:hover {
    background: rgba(59,130,246,0.25);
    border-color: var(--accent);
}
.admin-btn:disabled {
    opacity: 0.5; cursor: not-allowed;
}
#upload-done-btn{
    display:none;
    transition:all 0.5s ease-in-out;
}

.admin-result {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 10px
}
.admin-result.ok  { color: #4ade80; }
.admin-result.err { color: var(--danger); }

/* ---- Native drag-and-drop upload area ---- */
.admin-dropzone-area {
    border: 2px dashed rgba(59, 130, 246, 0.4);
    border-radius: var(--radius, 10px);
    background: rgba(59, 130, 246, 0.04);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin-top: 0.6rem;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    user-select: none;
}
.admin-dropzone-area:hover,
.admin-dropzone-area.drag-over {
    border-color: var(--accent, #3b82f6);
    background: rgba(59, 130, 246, 0.12);
}
.admin-dropzone-area.drag-over {
    border-style: solid;
}
.dz-upload-icon {
    width: 2rem;
    height: 2rem;
    stroke: var(--accent, #3b82f6);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.7;
    pointer-events: none;
}
.dz-upload-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    pointer-events: none;
}
.dz-upload-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
    pointer-events: none;
}
/* Per-file progress list */
.dz-file-list {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.dz-file-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    gap: 0.2rem;
}
.dz-file-thumb {
    width: 72px;
    height: 72px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border-color, #334155);
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.dz-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}
.dz-file-thumb.is-video svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke: var(--text-muted);
    fill: none;
}
.dz-file-name {
    font-size: 0.6rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 76px;
}
.dz-file-bar-wrap {
    width: 70px;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}
.dz-file-bar {
    height: 3px;
    width: 0%;
    background: var(--accent, #3b82f6);
    border-radius: 2px;
    transition: width 0.2s;
}
.dz-file-item.ok .dz-file-thumb  { outline: 2px solid #4ade80; outline-offset: 1px; }
.dz-file-item.err .dz-file-thumb { outline: 2px solid var(--danger, #f87171); outline-offset: 1px; }
.dz-file-item.ok .dz-file-bar   { background: #4ade80; width: 100%; }
.dz-file-item.err .dz-file-bar  { background: var(--danger, #f87171); width: 100%; }
.admin-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}
#admin-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}
/* -------------------------------- */

/* Login modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-box {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.modal-box h2 { font-size: 1.2rem; }
.modal-box input {
    width: 100%;
    padding: 0.6rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-main);
    font-size: 0.95rem;
    letter-spacing: normal;
}
.modal-box input:focus { outline: none; border-color: var(--accent); }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }
.modal-switch {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -0.25rem;
}
.modal-switch a { color: var(--accent); text-decoration: none; }
.modal-switch a:hover { text-decoration: underline; }

/* User (non-admin) badge */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(148,163,184,0.1);
    border: 1px solid rgba(148,163,184,0.3);
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 0.50rem 0.7rem;
    border-radius: 12px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(148,163,184,0.1);
    border: 1px solid rgba(148,163,184,0.3);
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 0.50rem 0.7rem;
    border-radius: 12px;
}

/* =============================================
   USER TABLE (Admin Users tab)
   ============================================= */
.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.user-table th,
.user-table td {
    text-align: left;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.user-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.user-table-row:hover { background: rgba(255,255,255,0.03); }
.user-table-email  { color: var(--text-muted); word-break: break-all; }
.user-table-date   { color: var(--text-muted); white-space: nowrap; }
.user-table-actions { white-space: nowrap; display: flex; gap: 0.35rem; }
.user-role-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.user-role-admin { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.user-role-user  { background: rgba(148,163,184,0.1); color: var(--text-muted); border: 1px solid rgba(148,163,184,0.2); }
.user-you-badge  { font-size: 0.72rem; color: var(--accent); opacity: 0.8; }

/* =====================================================
   FAVORITES – toolbar heart button active state
   ===================================================== */
#btn-favorite svg {
    fill:   none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    width: 1.1rem; height: 1.1rem;
    vertical-align: middle;
    transition: fill 0.2s, stroke 0.2s;
}
#btn-favorite.active svg {
    fill:   #ef4444;
    stroke: #ef4444;
}

/* =====================================================
   COMMENTS PANEL
   ===================================================== */
.lb-comments-panel {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    max-height: 55vh;
    background: var(--surface-color, #1e1e2e);
    border-top: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius, 8px) var(--radius, 8px) 0 0;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 20;
    overflow: hidden;
}
.lb-comments-panel.open { transform: translateY(0); }

.lb-comments-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.lb-comments-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}
.lb-comments-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
    transition: color 0.15s;
}
.lb-comments-close:hover { color: var(--text-main); }

.lb-comments-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.lb-comment {
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    font-size: 0.84rem;
}
.lb-comment__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}
.lb-comment__user {
    font-weight: 600;
    color: var(--accent);
    font-size: 0.8rem;
}
.lb-comment__date {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-left: auto;
}
.lb-comment__del {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.1rem;
    line-height: 1;
    margin-left: 0.35rem;
    transition: color 0.15s;
    flex-shrink: 0;
}
.lb-comment__del:hover { color: var(--danger, #ef4444); }
.lb-comment__body {
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}
.lb-comments-empty,
.lb-comments-loading {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem 0;
    margin: 0;
}
.lb-comment-form {
    padding: 0.6rem 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}
.lb-comment-textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius, 6px);
    color: var(--text-main);
    font-size: 0.84rem;
    padding: 0.45rem 0.65rem;
    line-height: 1.4;
    font-family: inherit;
    transition: border-color 0.15s;
}
.lb-comment-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Keep overlaybox visible when comments panel is pinned open */
.lightbox-overlaybox.pinned {
    opacity: 1 !important;
    display: block !important;
}

/* Comments toggle button SVG */
#btn-comments svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    width: 1.1rem; height: 1.1rem;
    vertical-align: middle;
}

/* =====================================================
   THUMBNAIL BADGES (favorites heart + comment count)
   ===================================================== */
.thumb-badges {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    pointer-events: none;
    z-index: 3;
}
.thumb-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px 2px 4px;
    border-radius: 99px;
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1.3;
    background: rgba(0,0,0,0.58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.thumb-badge svg {
    width: 0.72rem;
    height: 0.72rem;
    flex-shrink: 0;
    vertical-align: middle;
}
.thumb-badge--fav svg {
    fill:   #ef4444;
    stroke: none;
}
.thumb-badge--comment svg {
    fill:   none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* =====================================================
   LIGHTBOX TOOLBAR COMMENT COUNT BADGE
   ===================================================== */
.lb-btn--badged {
    position: relative;
}
.lb-btn-badge {
    position: absolute;
    top:    -2px;
    right:  -4px;
    min-width: 1.05rem;
    height:    1.05rem;
    padding: 0 3px;
    background: var(--accent, #6366f1);
    color: #fff;
    border-radius: 99px;
    font-size:   0.58rem;
    font-weight: 700;
    line-height: 1.05rem;
    text-align:  center;
    pointer-events: none;
}

/* Profile & admin-user modal role select */
#admin-user-role {
    background: var(--surface-color);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius);
    color: var(--text-main);
    font-size: 0.9rem;
    padding: 0.55rem 0.75rem;
}

/* Search Bar */
#search-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
@media (min-width: 640px) { #search-bar { flex-wrap: nowrap; gap: 0.75rem; margin-bottom: 1.5rem; } }
#search-input {
    flex: 1;
    padding: 0.6rem 1rem 0.6rem 2.6rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}
#search-input:focus { border-color: var(--accent); }
#search-input::placeholder { color: var(--text-muted); }
#search-wrap {
    position: relative;
    flex: 1;
    min-width: 160px;
    display: flex;
    align-items: center;
}
#search-wrap > svg {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
    width: 1rem;
    height: 1rem;
}
#search-clear {
    position: absolute;
    right: 0.6rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.2rem;
    display: none;
}
#search-clear:hover { color: var(--text-main); }
#search-status {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
    display: none;
}
.type-filter-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition);
    white-space: nowrap;
}
.type-filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Batch Selection */
body.selection-mode .image-card { cursor: default; }
.card-checkbox {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.45);
    border: 2px solid rgba(255,255,255,0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    transition: background 0.15s, border-color 0.15s;
}
.card-checkbox svg { width: 11px; height: 11px; stroke: white; stroke-width: 2.5; opacity: 0; }
body.selection-mode .card-checkbox { display: flex; }
.image-card.selected .card-checkbox { background: var(--accent); border-color: var(--accent); }
.image-card.selected .card-checkbox svg { opacity: 1; }
.image-card.selected { outline: 3px solid var(--accent); outline-offset: -3px; }
/* Batch Action Bar */
#batch-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    z-index: 900;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
}
body.selection-mode #batch-bar { display: flex; }
#batch-count { flex: 1; font-size: 0.9rem; color: var(--text-muted); }
/* Edit modal */
#edit-modal { z-index: 3000; }
.edit-preview {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--bg-color);
}
.edit-ops {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}
.edit-ops button {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.55rem 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.82rem;
    transition: var(--transition);
}
.edit-ops button:hover { background: var(--accent); border-color: var(--accent); }

/* Video */
.card-video-badge {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 52px; height: 52px;
    background: rgba(0,0,0,0.55);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    backdrop-filter: blur(2px);
}
.card-video-badge svg { width: 24px; height: 24px; }
#lb-video {
    display: none;
    max-width: min(90vw, 960px);
    max-height: 95vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    outline: none;
    background: #000;
}
/* Footer */
.site-footer {
    margin-top: 3rem;
    min-height: 250px;

    background: var(--footer-bg);
    margin: 0 -15px -15px -15px;
    padding: 0 20px;
}
.site-footer__inner {
    border-top: 1px solid var(--border-subtle);
    padding-top: 2rem;
    padding-bottom: 1.5rem;
}
.site-footer__stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 1024px) { .site-footer__stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .site-footer__stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .site-footer__stats { grid-template-columns: repeat(1, 1fr); } }

.site-footer__stat {
    background: var(--surface-color);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: border-color 0.2s;
}
.site-footer__stat:hover { border-color: rgba(59,130,246,0.35); }
.site-footer__stat-icon {
    width: 36px; height: 36px;
    background: rgba(59,130,246,0.1);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.site-footer__stat-icon svg {
    width: 1rem; height: 1rem;
    stroke: var(--accent); flex-shrink: 0;
}
.site-footer__stat-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}
.site-footer__stat-text strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
}
.site-footer__stat-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.site-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.site-footer__copy {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.6;
}
.site-footer__links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.site-footer__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--surface-color);
    border: 1px solid rgba(255,255,255,0.06);
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.site-footer__link:hover {
    color: var(--text-main);
    border-color: rgba(59,130,246,0.4);
    background: rgba(59,130,246,0.08);
}
.site-footer__link svg { width: 0.85rem; height: 0.85rem; flex-shrink: 0; }


/* Shared section heading (reused by gallery, recent, etc.) */
.section-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.85rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(59,130,246,0.2);
}
.section-heading svg {
    width: 0.9rem; height: 0.9rem;
    stroke: var(--accent); fill: none; flex-shrink: 0;
}

/* Recent Files Strip */
.recent-strip {
    margin-bottom: 1.75rem;
}
.recent-strip__heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.85rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(59,130,246,0.2);
}
.recent-strip__heading svg {
    width: 0.9rem; height: 0.9rem;
    stroke: var(--accent); flex-shrink: 0;
}
.recent-strip__items {
    display: grid;
    /*grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));*/
    grid-template-columns: repeat(auto-fill, minmax(min(19%, 100%), 1fr));
    gap: 0.75rem;
    /*max-height: 30vh;*/
    overflow: hidden;
}
@media (max-width: 640px) { .recent-strip__items {grid-template-columns: repeat(auto-fill, minmax(min(48%, 100%), 1fr)); } }
/* recent gallery cards use image-card base styles; just fix the height */
.recent-gallery-card {
    cursor: pointer;
    height: 100%;
}
.recent-gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.recent-strip__items .image-card {
    height: 140px;
    min-height: 231px;
}
/* Initial styling of the button */
#scrollToTopBtn {
  /* Positioning */
  position: fixed;
  bottom: 20px; /* Distance from bottom */
  right: 20px;  /* Distance from right */
  z-index: 99;  /* Makes sure it sits on top of other elements */
  
  /* Appearance */
  background-color: #333; /* Button background color */
  color: white;           /* Icon color */
  border: none;
  outline: none;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;     /* Makes it a circle */
  box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* Soft shadow */
  
  /* Fading Behavior - Starts Hidden */
  opacity: 0;              /* Fully transparent */
  visibility: hidden;      /* Prevents clicking while hidden */
  transition: all 0.4s ease; /* Smooth transition time */
}

/* Styling when the button is revealed by JavaScript */
#scrollToTopBtn.show {
  opacity: 1;             /* Fully visible */
  visibility: visible;
}

/* Hover effect */
#scrollToTopBtn:hover {
  background-color: #555; /* Slightly lighter on hover */
  transform: translateY(-3px); /* Gentle float-up effect */
}
.neon-text {
    font-size: 4rem;
    color: #fff;
    text-shadow: 0 0 5px #ff005e, 0 0 10px #ff005e, 0 0 20px #ff005e, 0 0 40px #ff005e, 0 0 80px #ff005e;
    animation: glow 1.5s infinite alternate;
}

@keyframes glow {
    0% {
        text-shadow: 0 0 5px #ff005e, 0 0 10px #ff005e, 0 0 20px #ff005e, 0 0 40px #ff005e, 0 0 80px #ff005e;
    }
    100% {
        text-shadow: 0 0 10px #00d4ff, 0 0 20px #00d4ff, 0 0 40px #00d4ff, 0 0 80px #00d4ff, 0 0 160px #00d4ff;
    }
}

/* .controlsbar replaced by .header-toolbar */

/* =============================================
   ADMIN SETTINGS SECTION
   ============================================= */
.admin-settings {
    padding: 10px 20px 20px 20px;
}
.admin-settings__heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.admin-settings__heading svg {
    width: 1rem; height: 1rem;
    flex-shrink: 0;
}
.admin-settings__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem 1.5rem;
}
.admin-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}
.admin-toggle:hover { background: rgba(255,255,255,0.07); }
.admin-toggle__label {
    font-size: 0.82rem;
    color: var(--text-main);
    flex: 1;
}
.admin-toggle__switch {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.admin-toggle__switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.admin-toggle__slider {
    position: absolute;
    inset: 0;
    background: var(--border-color);
    border-radius: 20px;
    transition: background 0.2s;
    cursor: pointer;
}
.admin-toggle__slider::before {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    left: 3px; top: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}
.admin-toggle__switch input:checked + .admin-toggle__slider {
    background: var(--accent);
}
.admin-toggle__switch input:checked + .admin-toggle__slider::before {
    transform: translateX(16px);
}

/* =============================================
   DISPLAY SETTINGS BODY-CLASS EFFECTS
   ============================================= */
body.setting-neon-off .neon-text {
    text-shadow: none;
    animation: none;
}
body.setting-top-off .header-top {
    display: none !important;
}
body.setting-toolbar-off .header-toolbar {
    display: none !important;
}
body.setting-recent-off .recent-strip {
    display: none !important;
}
body.setting-search-off #search-bar {
    display: none !important;
}
body.setting-hover-meta-off .image-overlay .meta div:last-child {
    display: none !important;
}
body.setting-show-filename-recents-off .filename-recent {
    display: none !important;
}
body.setting-show-filename-off .filename {
    display: none !important;
}


.lightbox-overlaybox{
    position:absolute;
    left:0; right:0; bottom:0;
    padding:10px;

    display:flex;
    flex-direction:column;
    background:rgba(0,0,0,0.5);
}

#lightbox-overlaybox {
    transition: opacity 0.5s ease;
    opacity: 1;
}

#lightbox-overlaybox.hidden {
    opacity: 0;
    pointer-events: none; /* Prevents clicking it while invisible */
}

/* =============================================
   VIP SECTIONS
   ============================================= */
.vip-strip {
    margin-bottom: 1.75rem;
}
.vip-heading {
    color: #f59e0b;
    border-bottom-color: rgba(245, 158, 11, 0.3);
}
.vip-heading svg {
    stroke: #f59e0b;
}
.vip-close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 0.3rem;
    flex-shrink: 0;
}
.vip-close-btn:hover { color: var(--text-main); }

.vip-strip__items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(19%, 100%), 1fr));
    gap: var(--gallery-gap);
}
@media (max-width: 640px) {
    .vip-strip__items { grid-template-columns: repeat(auto-fill, minmax(min(48%, 100%), 1fr)); }
}
.vip-strip__items .image-card {
    height: 140px;
    min-height: 140px;
}
.vip-strip__items .image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Admin VIP group manager */
.vip-admin-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-wrap: wrap;
}
.vip-admin-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.82rem;
    min-width: 0;
}
.vip-admin-code code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.78rem;
    color: #f59e0b;
    letter-spacing: 0.05em;
}
.vip-admin-count { color: var(--text-muted); }
.vip-admin-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* =============================================
   THEMES
   Applied via data-theme attribute on <html>
   ============================================= */

/* --- Dark theme --- */
[data-theme="dark"] {
    --bg-color:       #121212;
    --surface-color:  #1e1e1e;
    --text-main:      #e8e8e8;
    --text-muted:     #888888;
    --accent:         #3b82f6;
    --accent-hover:   #2563eb;
    --header-bg:      #0a0a0a;
    --footer-bg:      #0a0a0a;
    --border-color:   #2e2e2e;
    --border-subtle:  rgba(255,255,255,0.05);
    --skeleton-from:  #1e1e1e;
    --skeleton-mid:   #282828;
    --slider-bg:      #282828;
    --card-hover-bg:  #161616;
    --surface-input:  #121212;
}

/* --- Black (OLED) theme --- */
[data-theme="black"] {
    --bg-color:       #000000;
    --surface-color:  #0d0d0d;
    --text-main:      #ffffff;
    --text-muted:     #555555;
    --accent:         #3b82f6;
    --accent-hover:   #2563eb;
    --header-bg:      #000000;
    --footer-bg:      #000000;
    --border-color:   #1c1c1c;
    --border-subtle:  rgba(255,255,255,0.04);
    --skeleton-from:  #0d0d0d;
    --skeleton-mid:   #181818;
    --slider-bg:      #181818;
    --card-hover-bg:  #0a0a0a;
    --surface-input:  #000000;
}

/* --- White (light) theme --- */
[data-theme="white"] {
    --bg-color:       #f1f5f9;
    --surface-color:  #ffffff;
    --text-main:      #0f172a;
    --text-muted:     #64748b;
    --accent:         #2563eb;
    --accent-hover:   #1d4ed8;
    --danger:         #dc2626;
    --header-bg:      #e2e8f0;
    --footer-bg:      #e2e8f0;
    --border-color:   #cbd5e1;
    --border-subtle:  rgba(0,0,0,0.08);
    --skeleton-from:  #e2e8f0;
    --skeleton-mid:   #d1dae6;
    --slider-bg:      #cbd5e1;
    --card-hover-bg:  #eef2f7;
    --surface-input:  #f8fafc;
}
/* White theme — targeted fixes for elements that use dark-only rgba values */
[data-theme="white"] #sort-select,
[data-theme="white"] #hover-effect-select {
    border-color: var(--border-color);
    background: var(--surface-input);
    color: var(--text-main);
}
[data-theme="white"] .sort-wrap .select-wrap::after,
[data-theme="white"] .hover-effect-wrap .select-wrap::after { border-top-color: var(--text-muted); }
[data-theme="white"] .admin-toggle { background: rgba(0,0,0,0.03); }
[data-theme="white"] .admin-toggle:hover { background: rgba(0,0,0,0.06); }
[data-theme="white"] .lb-btn { color: var(--text-main); }
[data-theme="white"] .site-footer__link { border-color: var(--border-color); }
[data-theme="white"] .site-footer__link:hover { border-color: var(--accent); }
[data-theme="white"] .admin-settings { border-top-color: var(--border-color); }

/* =============================================
   THEME SWITCHER CONTROL
   ============================================= */
.theme-picker-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.2rem;
}
.theme-picker-wrap svg {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none; stroke-width: 1.5;
    flex-shrink: 0;
    color: var(--text-muted);
}
.theme-swatches {
    display: flex;
    gap: 4px;
    align-items: center;
}
.theme-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    flex-shrink: 0;
    padding: 0;
    outline: none;
}
.theme-btn:hover   { transform: scale(1.2); }
.theme-btn.active  { border-color: var(--accent); transform: scale(1.15); }
.theme-btn[data-theme="default"] { background: #0f172a; }
.theme-btn[data-theme="dark"]    { background: #1e1e1e; }
.theme-btn[data-theme="black"]   { background: #000000; box-shadow: 0 0 0 1px #555 inset; }
.theme-btn[data-theme="white"]   { background: #f1f5f9; box-shadow: 0 0 0 1px #cbd5e1 inset; }
.admin-stats-item{
    margin-top:0.2rem;
}
.hidemobile { display: flex; }
@media (hover: none) and (pointer: coarse) {
    /* Touch/mobile device — show camera+gallery buttons */
    .hidemobile { display: none; }
}
#toggle-btn {
  padding: 10px;
}