/* ========================================
   File Share – Minimal Clean Theme
   ======================================== */

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-hover: #22263a;
    --border: #2a2e3f;
    --text: #e4e6ef;
    --text-muted: #8b8fa3;
    --accent: #6c8cff;
    --accent-hover: #8ba4ff;
    --green: #4ade80;
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
}

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

/* ---- Layout ---- */

.container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px;
    flex: 1;
}

header {
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

/* ---- Breadcrumbs ---- */

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}

.breadcrumbs a:hover {
    background: var(--surface-hover);
}

.breadcrumbs .sep {
    color: var(--text-muted);
}

.breadcrumbs .current {
    color: var(--text);
    font-weight: 600;
}

/* ---- Stats bar ---- */

.stats {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    color: var(--text-muted);
}

/* ---- File Table ---- */

.file-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.file-table thead {
    background: var(--surface-hover);
}

.file-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.file-table th:hover {
    color: var(--text);
}

.file-table td {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

.file-table tr:hover {
    background: var(--surface-hover);
}

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

.file-link:hover .name {
    color: var(--accent);
}

.file-link .icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.file-link .name {
    transition: color 0.15s;
    word-break: break-all;
}

.dir-row .file-link .name {
    font-weight: 600;
}

.col-size, .col-date {
    white-space: nowrap;
    color: var(--text-muted);
}

.col-action {
    width: 100px;
    text-align: center;
}

/* ---- Checkbox column ---- */

.col-check {
    width: 40px;
    text-align: center;
    cursor: default;
}

.col-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* ---- Batch download bar ---- */

.batch-bar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
    z-index: 100;
    transition: bottom 0.25s ease;
    white-space: nowrap;
}

.batch-bar.visible {
    bottom: 24px;
}

.batch-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.batch-info strong {
    color: var(--accent);
}

.batch-actions {
    display: flex;
    gap: 8px;
}

.btn-batch-download {
    background: var(--green);
    color: #0f1117;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-batch-download:hover {
    background: #6ee7a0;
    color: #0f1117;
}

.btn-batch-download:disabled {
    opacity: 0.6;
    cursor: wait;
}

.batch-actions .btn-back {
    cursor: pointer;
    border: 1px solid var(--border);
}

/* ---- Buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-download {
    background: var(--accent);
    color: #fff;
}

.btn-download:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-back {
    background: var(--surface-hover);
    color: var(--text);
    border: 1px solid var(--border);
}

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

/* ---- Empty State ---- */

.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* ---- File Detail / Preview ---- */

.file-detail {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.file-meta {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.file-meta h2 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    word-break: break-all;
}

.meta-row {
    display: flex;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.preview-area {
    padding: 0;
}

.preview-text {
    max-height: 70vh;
    overflow: auto;
}

.preview-text pre {
    padding: 20px 24px;
    font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", "Consolas", monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text);
    tab-size: 4;
}

.preview-image {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #13151d;
}

.preview-image img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 4px;
}

.preview-video {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: #000;
}

.preview-video video {
    max-width: 100%;
    max-height: 75vh;
}

.preview-audio {
    padding: 40px 24px;
    display: flex;
    justify-content: center;
}

.preview-audio audio {
    width: 100%;
    max-width: 500px;
}

.preview-none {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.preview-none p:first-child {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

/* ---- Footer ---- */

footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
    .container {
        padding: 16px 12px;
    }

    .file-table th,
    .file-table td {
        padding: 8px 10px;
    }

    .col-date {
        display: none;
    }

    .col-action .btn {
        padding: 5px 10px;
        font-size: 0.78rem;
    }

    .meta-row {
        flex-direction: column;
        gap: 4px;
    }
}
