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

body {
    background: #0d1420;
    color: #e2e8f0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.88rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Subtle blue vignette at edges ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 55% 45% at 0% 0%, rgba(15, 45, 120, 0.35) 0%, transparent 65%),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(10, 35, 100, 0.30) 0%, transparent 65%),
        radial-gradient(ellipse 35% 40% at 100% 0%, rgba(20, 50, 110, 0.18) 0%, transparent 55%),
        radial-gradient(ellipse 35% 35% at 0% 100%, rgba(8, 28, 80, 0.22) 0%, transparent 55%);
    pointer-events: none;
    z-index: 0;
}

/* ── Animated Background Canvas ── */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ── Top navigation bar ── */
.topbar {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-transform: uppercase;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 5px rgba(34, 197, 94, 0.7);
    display: inline-block;
    flex-shrink: 0;
}

.topbar-right {
    font-size: 0.72rem;
    color: #475569;
    letter-spacing: 0.03em;
}

/* ── Main centered layout ── */
.main {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px 20px 90px;
}

/* ── Floating card ── */
.card {
    background: rgba(24, 32, 48, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.3),
        0 12px 40px rgba(0, 0, 0, 0.45);
    width: 100%;
    max-width: 600px;
    padding: 24px 24px 20px;
    position: relative;
}

/* ── Path title inside card ── */
.card-path {
    font-size: 1.55rem;
    font-weight: 500;
    color: #f1f5f9;
    margin-bottom: 14px;
    letter-spacing: 0.01em;
    word-break: break-all;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.search-input {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    width: 160px;
    transition: all 0.2s ease-in-out;
    outline: none;
    font-family: inherit;
}

.search-input:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-input::placeholder {
    color: #475569;
}

/* ── Divider inside card ── */
.card-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 6px;
}

/* ── File list rows ── */
.row {
    display: grid;
    grid-template-columns: 28px 1fr 64px;
    gap: 0 10px;
    align-items: center;
    padding: 5px 6px;
    border-radius: 7px;
    transition: background 0.12s;
}

.row:hover {
    background: rgba(255, 255, 255, 0.045);
}

/* ── UP link row ── */
.up-row {
    padding: 4px 6px;
}

.up-link {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #475569;
    text-decoration: none;
    font-size: 0.80rem;
}

.up-link:hover {
    color: #94a3b8;
}

/* ── Icon badge ── */
.badge {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Folder badge: amber */
.badge-dir {
    background: #92400e;
    color: #fcd34d;
    font-size: 0.65rem;
}

/* File badges by extension */
.badge-file {
    background: #1e3a5f;
    color: #7dd3fc;
}

.badge-sh {
    background: #14532d;
    color: #86efac;
}

.badge-py {
    background: #312e81;
    color: #a5b4fc;
}

.badge-js {
    background: #713f12;
    color: #fde68a;
}

.badge-json {
    background: #134e4a;
    color: #6ee7b7;
}

.badge-img {
    background: #4a1d96;
    color: #c4b5fd;
}

.badge-zip {
    background: #1f2937;
    color: #9ca3af;
}

.badge-pdf {
    background: #7f1d1d;
    color: #fca5a5;
}

/* ── Item name ── */
.item-name {
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.item-name.is-dir {
    color: #f1f5f9;
}

.item-name.is-dir:hover {
    color: #fcd34d;
    text-decoration: none;
}

.item-name.is-file {
    color: #cbd5e1;
}

.item-name.is-file:hover {
    color: #93c5fd;
    text-decoration: none;
}

/* ── Item size ── */
.item-size {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    color: #334155;
    text-align: right;
    padding-right: 4px;
}

/* ── Empty state ── */
.empty-msg {
    color: #334155;
    font-size: 0.82rem;
    padding: 10px 6px;
}

/* ── Footer ── */
.footer {
    position: absolute;
    bottom: -65px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.75rem;
    color: #475569;
    letter-spacing: 0.02em;
}

.footer a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s;
}

.footer a:hover {
    color: #94a3b8;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 12px;
}

.social-links a {
    color: #475569;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    color: #93c5fd;
    transform: translateY(-2px);
}

.social-links svg {
    width: 18px;
    height: 18px;
}

/* ── Responsive ── */
@media (max-width: 500px) {
    .card {
        padding: 18px 14px 16px;
        border-radius: 10px;
    }

    .card-path {
        font-size: 1.25rem;
    }

    .row {
        grid-template-columns: 26px 1fr 52px;
    }
}