/* ═══════════════════════════════════════════════════════════════════════════
   TOLE TOLE MEDIA ARCHIVE — Shared Stylesheet
   Edit the variables in :root to retheme both index.php and request.php
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── THEME CONFIGURATION ────────────────────────────────────────────────────
   Change these CSS custom properties to retheme the entire site.
   ────────────────────────────────────────────────────────────────────────── */
:root {
    /* Backgrounds */
    --bg:           #0d0d0f;
    --surface:      #141416;
    --card:         #1a1a1e;

    /* Borders */
    --border:       #2a2a30;
    --border2:      #333340;

    /* Text */
    --text:         #e8e8f0;
    --muted:        #7a7a90;

    /* Accent colours */
    --accent:       #e8620a;
    --accent2:      #f59340;

    /* Semantic colours */
    --green:        #34d399;
    --amber:        #fbbf24;
    --red:          #f87171;
    --blue:         #60a5fa;

    /* Shape */
    --radius:       12px;
    --radius-lg:    18px;

    /* Typography */
    --mono:         'DM Mono', monospace;
    --sans:         'Syne', sans-serif;

    /* Ambient glow colours (background radial gradients) */
    --glow-a:       rgba(232, 98, 10, .12);
    --glow-b:       rgba(245, 147, 64, .08);
}


/* ── RESET & BASE ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% -10%, var(--glow-a) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 80% 110%, var(--glow-b) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */
.wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0 32px 80px;
}


/* ── HEADER / TOP BAR ────────────────────────────────────────────────────── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.logo-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.header-meta {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
}

/* Top-bar navigation links (used on request.php) */
.nav-links { display: flex; gap: 8px; }

.nav-link {
    font-family: var(--mono);
    font-size: 12px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    transition: border-color .2s, color .2s;
}

.nav-link:hover { border-color: var(--border2); color: var(--text); }

.nav-link.active {
    border-color: var(--accent);
    color: var(--accent2);
    background: rgba(232, 98, 10, .08);
}

/* "Request Upload" button variant (used on index.php) */
.request-btn {
    font-family: var(--mono);
    font-size: 12px;
    padding: 6px 14px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    color: var(--accent2);
    background: rgba(232, 98, 10, .08);
    text-decoration: none;
    transition: background .2s, border-color .2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.request-btn:hover {
    background: rgba(232, 98, 10, .16);
    border-color: var(--accent2);
}


/* ── BREADCRUMBS ─────────────────────────────────────────────────────────── */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.breadcrumbs a,
.breadcrumbs span {
    font-family: var(--mono);
    font-size: 13px;
    text-decoration: none;
    color: var(--muted);
    transition: color .2s;
}

.breadcrumbs a:hover { color: var(--accent2); }
.breadcrumbs .current { color: var(--text); font-weight: 500; }
.breadcrumbs .sep { color: var(--border2); }


/* ── TOOLBAR (index.php) ─────────────────────────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.toolbar-left { display: flex; align-items: center; gap: 12px; }

.dir-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.count-badge {
    font-family: var(--mono);
    font-size: 11px;
    padding: 3px 10px;
    background: var(--border);
    border-radius: 20px;
    color: var(--muted);
}

.toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Search box */
.search-box {
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    gap: 8px;
    transition: border-color .2s;
}

.search-box:focus-within { border-color: var(--accent); }
.search-box svg { color: var(--muted); flex-shrink: 0; }

.search-box input {
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    width: 180px;
    padding: 8px 0;
}

.search-box input::placeholder { color: var(--muted); }

/* Filter buttons */
.filter-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-btn {
    font-family: var(--mono);
    font-size: 11px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--muted);
    cursor: pointer;
    transition: border-color .2s, color .2s, background .2s;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--accent);
    color: var(--accent2);
    background: rgba(232, 98, 10, .1);
}


/* ── BACK BUTTON ─────────────────────────────────────────────────────────── */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    font-family: var(--mono);
    transition: border-color .2s, color .2s, background .2s;
    margin-bottom: 24px;
}

.back-btn:hover {
    border-color: var(--border2);
    color: var(--text);
    background: var(--border);
}


/* ── FILE GRID ───────────────────────────────────────────────────────────── */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}


/* ── FOLDER CARD ─────────────────────────────────────────────────────────── */
.folder-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: border-color .22s cubic-bezier(.4,0,.2,1),
                transform       .22s cubic-bezier(.4,0,.2,1),
                box-shadow      .22s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
    position: relative;
}

.folder-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(232, 98, 10, .18);
}

.folder-preview {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, rgba(232,98,10,.12), rgba(245,147,64,.06));
    display: grid;
    place-items: center;
    font-size: 52px;
    position: relative;
}

.folder-badge {
    position: absolute;
    bottom: 8px; right: 10px;
    font-family: var(--mono);
    font-size: 10px;
    padding: 2px 8px;
    background: rgba(232, 98, 10, .25);
    border: 1px solid rgba(232, 98, 10, .4);
    border-radius: 20px;
    color: var(--accent2);
}

.folder-meta {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.folder-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-count {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}


/* ── FILE CARD ───────────────────────────────────────────────────────────── */
.file-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: border-color .22s cubic-bezier(.4,0,.2,1),
                transform       .22s cubic-bezier(.4,0,.2,1),
                box-shadow      .22s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
}

.file-card:hover {
    border-color: var(--border2);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,.4);
}

.file-preview {
    aspect-ratio: 4/3;
    background: var(--surface);
    display: grid;
    place-items: center;
    overflow: hidden;
    position: relative;
}

/* Lazy-load shimmer */
.file-preview.lazy-pending {
    background: linear-gradient(90deg, var(--surface) 25%, var(--card) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.file-preview img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.file-card:hover .file-preview img { transform: scale(1.05); }

.file-preview video { width: 100%; height: 100%; object-fit: cover; }

/* Fade-in for lazy content */
.file-preview img.lazy-img,
.file-preview video.lazy-video {
    opacity: 0;
    transition: opacity .3s ease, transform .4s ease;
}

.file-preview img.lazy-img.loaded,
.file-preview video.lazy-video.loaded { opacity: 1; }

/* Non-image file type icon */
.file-type-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.type-emoji { font-size: 36px; }

.type-ext {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .1em;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.type-image .type-ext  { background: rgba(52,211,153,.15);  color: var(--green); }
.type-video .type-ext  { background: rgba(248,113,113,.15); color: var(--red); }
.type-audio .type-ext  { background: rgba(251,191,36,.15);  color: var(--amber); }
.type-pdf   .type-ext  { background: rgba(248,113,113,.15); color: var(--red); }
.type-doc   .type-ext  { background: rgba(96,165,250,.15);  color: var(--blue); }
.type-sheet .type-ext  { background: rgba(52,211,153,.15);  color: var(--green); }
.type-slide .type-ext  { background: rgba(251,191,36,.15);  color: var(--amber); }
.type-code  .type-ext  { background: rgba(245,147,64,.15);  color: var(--accent2); }
.type-zip   .type-ext  { background: rgba(251,191,36,.15);  color: var(--amber); }
.type-other .type-ext  { background: var(--border);          color: var(--muted); }

/* Video play overlay */
.play-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.35);
    display: grid;
    place-items: center;
    opacity: 0;
    transition: opacity .22s;
}

.file-card:hover .play-overlay { opacity: 1; }

.play-btn {
    width: 44px; height: 44px;
    background: rgba(255,255,255,.9);
    border-radius: 50%;
    display: grid;
    place-items: center;
}

/* File metadata row */
.file-meta {
    padding: 10px 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}


/* ── LIGHTBOX ────────────────────────────────────────────────────────────── */
.lightbox {
    display: none;
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.92);
    backdrop-filter: blur(12px);
    place-items: center;
}

.lightbox.open { display: grid; }

.lightbox-inner {
    position: relative;
    max-width: 92vw; max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.lightbox-close {
    position: fixed; top: 20px; right: 24px;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px; height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 20px;
    transition: background .2s;
    z-index: 10;
}

.lightbox-close:hover { background: var(--border); }

.lightbox-media { max-width: 90vw; max-height: 80vh; border-radius: 10px; }
.lightbox-media img   { max-width: 90vw; max-height: 78vh; object-fit: contain; border-radius: 10px; display: block; }
.lightbox-media video { max-width: 90vw; max-height: 78vh; border-radius: 10px; }
.lightbox-media audio { width: 400px; max-width: 90vw; }
.lightbox-media iframe { width: min(900px, 90vw); height: 80vh; border-radius: 10px; border: none; }

.lightbox-caption {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
}

.lightbox-nav {
    position: fixed; top: 50%; transform: translateY(-50%);
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    width: 44px; height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 18px;
    transition: background .2s;
    z-index: 10;
}

.lightbox-nav:hover { background: var(--border); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-dl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 12px;
    padding: 6px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    transition: border-color .2s, color .2s;
}

.lightbox-dl:hover { border-color: var(--accent); color: var(--accent2); }


/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--muted);
}

.empty .icon { font-size: 52px; margin-bottom: 16px; }
.empty h3 { font-size: 20px; margin-bottom: 8px; color: var(--text); }
.empty p  { font-family: var(--mono); font-size: 13px; }


/* ── REQUEST / UPLOAD PAGE ───────────────────────────────────────────────── */
header.request-header { margin-bottom: 48px; }

.hero { max-width: 560px; margin-bottom: 40px; }

.hero-label {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--accent2);
    margin-bottom: 12px;
}

.hero h1 {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 14px;
}

.hero p { font-size: 15px; color: var(--muted); line-height: 1.6; }

/* Form card */
.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 40px;
    max-width: 680px;
}

.form-group { margin-bottom: 24px; }

.form-label {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--muted);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}

.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--muted); }
textarea.form-input { resize: vertical; min-height: 90px; line-height: 1.5; }

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border2);
    border-radius: 14px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .25s, background .25s;
    background: var(--surface);
    position: relative;
}

.dropzone.dragover {
    border-color: var(--accent);
    background: rgba(232, 98, 10, .06);
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dz-icon   { font-size: 40px; margin-bottom: 14px; }
.dz-title  { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.dz-sub    { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.dz-limits {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.dz-limit-pill {
    font-family: var(--mono);
    font-size: 11px;
    padding: 4px 12px;
    background: var(--border);
    border-radius: 20px;
    color: var(--muted);
}

/* File list (upload page) */
.file-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
}

.file-item.over-limit { border-color: var(--red); }
.file-item-icon  { font-size: 18px; flex-shrink: 0; }
.file-item-info  { flex: 1; min-width: 0; }

.file-item-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-item-size { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.file-item.over-limit .file-item-size { color: var(--red); }

.file-item-remove {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color .15s, background .15s;
    flex-shrink: 0;
    line-height: 1;
}

.file-item-remove:hover { color: var(--red); background: rgba(248,113,113,.1); }

/* Submit row */
.submit-row {
    margin-top: 32px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-submit {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(232, 98, 10, .35);
}

.btn-submit:disabled {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-note { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Alerts */
.alert {
    border-radius: 10px;
    padding: 14px 18px;
    font-family: var(--mono);
    font-size: 13px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.alert-error {
    background: rgba(248, 113, 113, .08);
    border: 1px solid rgba(248, 113, 113, .3);
    color: var(--red);
}

.alert ul { padding-left: 18px; }
.alert li { margin-top: 4px; }

/* Success card */
.success-card {
    background: var(--card);
    border: 1px solid rgba(52,211,153,.25);
    border-radius: 20px;
    padding: 56px 40px;
    max-width: 560px;
    text-align: center;
}

.success-icon  { font-size: 56px; margin-bottom: 20px; }

.success-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.success-sub {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 28px;
    line-height: 1.6;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    padding: 11px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    transition: border-color .2s, color .2s;
}

.btn-ghost:hover { border-color: var(--border2); color: var(--text); }


/* ── SCROLLBAR ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }


/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .wrap { padding: 0 16px 60px; }
    .toolbar { flex-direction: column; align-items: flex-start; }
    .search-box input { width: 140px; }
    .file-grid { grid-template-columns: 1fr 1fr; }
    .lightbox-nav { display: none; }
    .form-card { padding: 24px 20px; }
}
