/* ============================================================
   DanyaFileServer — Minimal Theme System v2
   ============================================================ */

/* ---------- Dark Theme (default) ---------- */
:root,
body {
    --bg: #0d0d12;
    --bg-card: #16161d;
    --bg-hover: #1f1f28;
    --text: #ebebef;
    --text-muted: #8b8b93;
    --accent: #8c8c95;
    --accent-hover: #b0b0b8;
    --border: #2a2a35;
    --input-bg: #111118;
    --danger: #e0556a;
    --success: #4caf88;
    --warning: #e0a44c;
    --radius: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.25);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.35);
}

/* ============================================================
   Base & Typography
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--accent-hover);
}

h2, h3, h4, h5 {
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.75rem;
    line-height: 1.3;
}
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }

code {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.875em;
    background: var(--bg-hover);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    color: var(--accent);
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
    opacity: 0.6;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   Layout
   ============================================================ */

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    flex: 1;
    width: 100%;
    animation: fadeUp 0.3s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   SVG Icons
   ============================================================ */

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    vertical-align: middle;
}
.icon svg {
    width: 100%;
    height: 100%;
}
.icon-sm {
    width: 18px;
    height: 18px;
}
.icon-lg {
    width: 32px;
    height: 32px;
}
.icon-xl {
    width: 48px;
    height: 48px;
}

/* ============================================================
   Navbar
   ============================================================ */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 1.25rem;
    height: 52px;
    display: flex;
    align-items: center;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
    animation: none;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    letter-spacing: -0.2px;
}
.navbar-brand:hover { color: var(--text); }
.navbar-brand .icon { color: var(--accent); }

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    cursor: pointer;
}
.navbar-nav .nav-link:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.navbar-nav .nav-link.active {
    color: var(--accent);
}

.navbar-nav .nav-link .icon {
    width: 20px;
    height: 20px;
}

.navbar-nav .user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
}
.theme-toggle-btn:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.theme-toggle-btn .icon {
    width: 18px;
    height: 18px;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}
.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

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

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    background: var(--bg-hover);
    color: var(--text);
    text-decoration: none;
    line-height: 1.4;
}
.btn:hover {
    opacity: 0.9;
    color: var(--text);
}
.btn:active { opacity: 0.8; }

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

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}
.btn-success:hover { filter: brightness(1.1); color: #fff; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.btn-danger:hover { filter: brightness(1.1); color: #fff; }

.btn-warning {
    background: var(--warning);
    color: #111;
    border-color: var(--warning);
}
.btn-warning:hover { filter: brightness(1.1); color: #111; }

.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text-muted);
}
.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--accent);
    color: var(--accent);
}
.btn-outline-primary:hover {
    background: var(--accent);
    color: #fff;
}

.btn-outline-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}
.btn-outline-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
}
.btn-lg {
    padding: 0.65rem 1.5rem;
    font-size: 1rem;
}

.btn-group {
    display: flex;
    gap: 0.35rem;
}

.btn .icon {
    width: 18px;
    height: 18px;
}
.btn-sm .icon {
    width: 15px;
    height: 15px;
}
.btn-lg .icon {
    width: 22px;
    height: 22px;
}

/* ============================================================
   Forms
   ============================================================ */

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
}

.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
    line-height: 1.45;
}
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
.form-control::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.form-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.form-control[type="file"] {
    padding: 0.4rem;
    font-size: 0.85rem;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
}
.form-control[type="file"]::file-selector-button {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) - 2px);
    color: var(--text);
    padding: 0.35rem 0.75rem;
    margin-right: 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease;
}
.form-control[type="file"]::file-selector-button:hover {
    background: var(--accent);
    color: #fff;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}
.form-check-input {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
}

.input-group {
    display: flex;
    gap: 0.5rem;
}
.input-group .form-control {
    flex: 1;
}
.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.8rem;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* ============================================================
   Tables
   ============================================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table thead th {
    padding: 0.65rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.table tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover td {
    background: var(--bg-hover);
}

.table tbody tr {
    transition: background 0.1s ease;
}

/* ============================================================
   Nav Tabs
   ============================================================ */

.nav-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.nav-tabs .nav-link {
    padding: 0.55rem 1rem;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
    border-radius: 0;
}
.nav-tabs .nav-link:hover {
    color: var(--text);
}
.nav-tabs .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================================
   Alerts
   ============================================================ */

.alert {
    padding: 0.8rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 450;
    animation: slideDown 0.3s ease;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success { border-left: 3px solid var(--success); }
.alert-danger  { border-left: 3px solid var(--danger); }
.alert-warning { border-left: 3px solid var(--warning); }
.alert-info    { border-left: 3px solid var(--accent); }

.alert .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.alert-success .icon { color: var(--success); }
.alert-danger .icon { color: var(--danger); }
.alert-warning .icon { color: var(--warning); }
.alert-info .icon { color: var(--accent); }

.alert .btn-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    line-height: 1;
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.55em;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 20px;
    background: var(--bg-hover);
    color: var(--text-muted);
    white-space: nowrap;
}

.badge-success { background: rgba(76,175,136,0.15); color: var(--success); }
.badge-danger { background: rgba(224,85,106,0.15); color: var(--danger); }
.badge-warning { background: rgba(224,164,76,0.15); color: var(--warning); }
.badge-info { background: rgba(108,140,255,0.15); color: var(--accent); }
.badge-secondary { background: var(--bg-hover); color: var(--text-muted); }

/* ============================================================
   Modals
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeUp 0.2s ease;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
    line-height: 1;
}
.modal-close:hover { color: var(--text); }

/* ============================================================
   Breadcrumbs
   ============================================================ */

.breadcrumb {
    display: flex;
    gap: 0.35rem;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    font-size: 0.85rem;
    align-items: center;
    flex-wrap: wrap;
}
.breadcrumb-item {
    color: var(--text-muted);
}
.breadcrumb-item a {
    color: var(--accent);
}
.breadcrumb-item + .breadcrumb-item::before {
    content: '/';
    margin-right: 0.35rem;
    color: var(--text-muted);
    opacity: 0.5;
}
.breadcrumb-item.active {
    color: var(--text-muted);
}

/* ============================================================
   Footer
   ============================================================ */

footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2rem;
    background: rgba(14,14,20,0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255,255,255,0.06);
    position: relative;
    z-index: 1;
}

footer::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0; right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(14,14,20,0.3), transparent);
    pointer-events: none;
}

/* ============================================================
   Drop Zone
   ============================================================ */

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    margin-bottom: 1rem;
}

.drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(108,140,255,0.06);
    color: var(--accent);
}

.drop-zone .icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.5rem;
}

/* ============================================================
   Progress Bar
   ============================================================ */

.progress {
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-bar-success { background: var(--success); }
.progress-bar-danger { background: var(--danger); }
.progress-bar-warning { background: var(--warning); }
.progress-bar-info { background: var(--accent); }

/* ============================================================
   Search Results
   ============================================================ */

.search-results {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background 0.12s ease;
}
.search-result-item:hover {
    background: var(--bg-hover);
}

.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.search-thumb {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
    overflow: hidden;
}
.search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-item .text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   File Preview Modal
   ============================================================ */

.file-preview-content {
    text-align: center;
}

.file-preview-content img,
.file-preview-content video {
    max-width: 100%;
    max-height: 60vh;
    border-radius: 4px;
}

.file-preview-content audio {
    width: 100%;
    margin: 0.5rem 0;
}

.file-preview-content pre {
    text-align: left;
    background: var(--bg);
    color: var(--text);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    max-height: 55vh;
    font-size: 0.8rem;
    line-height: 1.55;
    margin: 0;
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
}

/* ============================================================
   Spinner
   ============================================================ */

.spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 36px;
    height: 36px;
    border-width: 3px;
}

/* ============================================================
   Progress Download Indicator (Music page)
   ============================================================ */

.download-progress {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-md);
    font-size: 0.8rem;
    min-width: 240px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.download-progress.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

/* ============================================================
   Share Link
   ============================================================ */

.share-link-box {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.share-link-box input {
    flex: 1;
}
.share-link-expiry {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ============================================================
   Utilities
   ============================================================ */

.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-accent { color: var(--accent) !important; }

.text-center { text-align: center; }
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.me-2 { margin-right: 0.75rem; }
.ms-auto { margin-left: auto; }

.py-4 { padding-top: 2rem; padding-bottom: 2rem; }
.p-0 { padding: 0; }

.w-100 { width: 100%; }

.d-flex { display: flex; }
.d-inline { display: inline; }
.d-none { display: none !important; }
.d-block { display: block; }

.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-shrink-0 { flex-shrink: 0; }
.overflow-hidden { overflow: hidden; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 0.75rem; }
.gap-3 { gap: 1rem; }

.fw-semibold { font-weight: 600; }
.small { font-size: 0.82rem; }

.rounded { border-radius: 50%; }

/* ============================================================
   Row / Col grid
   ============================================================ */

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.col-12 { flex: 0 0 100%; }
.col-md-6 { flex: 0 0 calc(50% - 0.625rem); }
.col-md-5 { flex: 0 0 calc(41.666% - 0.625rem); }
.col-md-4 { flex: 0 0 calc(33.333% - 0.625rem); }
.col-md-3 { flex: 0 0 calc(25% - 0.625rem); }

@media (max-width: 767px) {
    .col-md-6, .col-md-5, .col-md-4, .col-md-3 {
        flex: 0 0 100%;
    }
    .nav-tabs { flex-wrap: wrap; }
    .container { padding: 1rem 0.75rem; }
    .table { display: block; overflow-x: auto; }
}

/* Hamburger menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 44px;
    height: 44px;
    justify-content: center;
    align-items: center;
    border-radius: var(--radius);
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 767px) {
    .hamburger { display: flex; }
    .navbar-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 52px;
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 0.5rem 1rem;
        z-index: 999;
    }
    .navbar-nav.open { display: flex; }
    .navbar .container { flex-wrap: wrap; }
}

/* ============================================================
   Checkmark animation
   ============================================================ */

@keyframes checkmarkBounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.checkmark-anim {
    animation: checkmarkBounce 0.4s ease;
}

/* ============================================================
   Tabs content
   ============================================================ */

.tab-content > .tab-pane {
    display: none;
}
.tab-content > .tab-pane.active {
    display: block;
    animation: fadeUp 0.25s ease;
}

/* Password strength in register */
#pwdStrength {
    transition: width 0.3s ease;
}

/* ============================================================
   Canvas Background
   ============================================================ */

#bgCanvas {
    position: fixed;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
}

body.bg-animated #bgCanvas {
    display: block;
}

/* Star button & effect dropdown */
.bg-toggle-wrap {
    position: relative;
}

.bg-toggle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.bg-toggle:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.bg-toggle.active {
    color: var(--accent);
    border-color: var(--accent);
}

.bg-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 2000;
    padding: 6px;
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.bg-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.bg-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.45rem 0.7rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 5px;
    text-align: left;
    transition: background 0.1s ease, color 0.1s ease;
    line-height: 1.4;
}
.bg-dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}
.bg-dropdown-item.active {
    color: var(--accent);
    background: var(--bg-hover);
}

.bg-dropdown-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bg-dropdown-dot.off       { background: var(--text-muted); }
.bg-dropdown-dot.lavat     { background: #6c6cff; box-shadow: 0 0 6px rgba(108,108,255,0.5); }
.bg-dropdown-dot.aafire    { background: #ff6c20; box-shadow: 0 0 6px rgba(255,108,32,0.5); }
.bg-dropdown-dot.matrix    { background: #0f0;    box-shadow: 0 0 6px rgba(0,255,0,0.5); }
.bg-dropdown-dot.particles { background: #fff;    box-shadow: 0 0 6px rgba(255,255,255,0.5); }
.bg-dropdown-dot.waves     { background: #8c8cff; box-shadow: 0 0 6px rgba(140,140,255,0.5); }

.bg-dropdown-sep {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
}

.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0 6px;
    margin-left: 4px;
}
/* ============================================================
   File Explorer Styles v2 - Enhanced
   ============================================================ */

.file-explorer {
    display: flex;
    gap: 1rem;
    min-height: calc(100vh - 180px);
}

/* Sidebar */
.explorer-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
}

.sidebar-header .icon {
    width: 18px;
    height: 18px;
}

.sidebar-tree {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.1s ease;
    user-select: none;
}

.tree-item:hover {
    background: var(--bg-hover);
}

.tree-item.active {
    background: var(--accent);
    color: #fff;
}

.tree-item.active .tree-icon,
.tree-item.active .tree-label {
    color: #fff;
}

.tree-toggle {
    width: 16px;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    flex-shrink: 0;
    cursor: pointer;
}

.tree-icon {
    width: 18px;
    height: 18px;
    color: var(--warning);
    flex-shrink: 0;
}

.tree-icon svg {
    width: 100%;
    height: 100%;
}

.tree-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.tree-root {
    font-weight: 600;
}

.tree-children {
    padding-left: 1rem;
}

.tree-node {
    margin: 0;
}

.tree-loading,
.tree-empty {
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Main content */
.explorer-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
}

/* Toolbar */
.explorer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.toolbar-path {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.path-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    overflow: hidden;
    flex-wrap: wrap;
}

.path-item {
    color: var(--accent);
    white-space: nowrap;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: background 0.1s ease;
}

.path-item:hover {
    background: var(--bg-hover);
}

.path-sep {
    color: var(--text-muted);
    opacity: 0.5;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-toggle {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.view-btn {
    border: none;
    border-radius: 0;
    padding: 0.4rem 0.6rem;
}

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

/* Search */
.explorer-search {
    position: relative;
}

.explorer-search .form-control {
    padding-left: 0.8rem;
}

/* Bulk actions */
.explorer-bulk {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    animation: slideDown 0.2s ease;
}

.bulk-count {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
}

/* Drop zone */
.explorer-dropzone {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.explorer-dropzone.drag-over {
    pointer-events: auto;
    opacity: 1;
}

.dropzone-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(108, 140, 255, 0.15);
    border: 3px dashed var(--accent);
    border-radius: var(--radius);
    color: var(--accent);
}

.dropzone-overlay .icon {
    width: 48px;
    height: 48px;
}

.dropzone-overlay p {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
}

/* File content */
.explorer-content {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 300px;
}

/* List view */
.file-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.file-table thead th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
    position: sticky;
    top: 0;
    z-index: 1;
}

.file-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

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

.sort-arrow {
    display: inline-block;
    width: 12px;
}

.sort-asc .sort-arrow::after {
    content: '▲';
    font-size: 0.6rem;
    color: var(--accent);
}

.sort-desc .sort-arrow::after {
    content: '▼';
    font-size: 0.6rem;
    color: var(--accent);
}

.file-table tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.file-table tbody tr:last-child td {
    border-bottom: none;
}

.file-row {
    transition: background 0.1s ease;
    cursor: default;
}

.file-row:hover {
    background: var(--bg-hover);
}

.file-row.selected {
    background: rgba(108, 140, 255, 0.15);
}

.file-row.selected:hover {
    background: rgba(108, 140, 255, 0.2);
}

.file-row.parent-row {
    background: var(--bg);
}

.file-row.parent-row:hover {
    background: var(--bg-hover);
}

.col-check {
    width: 32px;
    text-align: center;
}

.col-name {
    min-width: 200px;
}

.col-size {
    width: 100px;
    text-align: right;
    color: var(--text-muted);
}

.col-date {
    width: 140px;
    color: var(--text-muted);
}

.col-actions {
    width: 180px;
    text-align: right;
}

.file-row .icon-sm {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.folder-icon {
    color: var(--warning);
}

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

.item-link {
    color: var(--text);
}

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

.parent-link {
    font-weight: 500;
}

/* Grid view */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.1s ease, outline 0.1s ease;
    text-align: center;
}

.grid-item:hover {
    background: var(--bg-hover);
}

.grid-item.selected {
    background: rgba(108, 140, 255, 0.15);
    outline: 2px solid var(--accent);
}

.grid-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
}

.grid-item[data-is-dir="true"] .grid-icon {
    color: var(--warning);
}

.grid-icon svg {
    width: 100%;
    height: 100%;
}

.grid-name {
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.grid-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.grid-empty {
    grid-column: 1 / -1;
}

/* Upload progress */
.explorer-upload-progress {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.upload-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
}

.upload-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.upload-progress-list {
    max-height: 180px;
    overflow-y: auto;
}

.upload-item {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.upload-item:last-child {
    border-bottom: none;
}

.upload-item.completed .upload-item-status {
    color: var(--success);
}

.upload-item.error .upload-item-status {
    color: var(--danger);
}

.upload-item-name {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.upload-item-progress .progress {
    height: 4px;
    margin: 0;
}

.upload-item-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.upload-progress-total {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border);
}

.upload-progress-total .progress {
    height: 6px;
    margin-bottom: 0.25rem;
}

.upload-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Context menu */
.context-menu {
    position: fixed;
    z-index: 2000;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 0.5rem;
    animation: fadeIn 0.1s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.context-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.1s ease;
}

.context-item:hover {
    background: var(--bg-hover);
}

.context-danger {
    color: var(--danger);
}

.context-danger:hover {
    background: rgba(224, 85, 106, 0.1);
}

.context-sep {
    height: 1px;
    background: var(--border);
    margin: 0.25rem 0.5rem;
}

/* Move modal tree */
.move-tree {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.move-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.1s ease;
}

.move-item:hover {
    background: var(--bg-hover);
}

.move-item.selected {
    background: var(--accent);
    color: #fff;
}

.move-item.selected .move-icon {
    color: #fff;
}

.move-icon {
    width: 18px;
    height: 18px;
    color: var(--warning);
    flex-shrink: 0;
}

.move-icon svg {
    width: 100%;
    height: 100%;
}

.move-node {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.move-toggle {
    width: 20px;
    font-size: 0.7rem;
    color: var(--text-muted);
    cursor: pointer;
    text-align: center;
    padding: 0.5rem 0;
    flex-shrink: 0;
}

.move-children {
    padding-left: 1.25rem;
    width: 100%;
}

.move-loading {
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 767px) {
    .file-explorer {
        flex-direction: column;
    }

    .explorer-sidebar {
        width: 100%;
        max-height: 200px;
    }

    .explorer-toolbar {
        flex-wrap: wrap;
    }

    .toolbar-path {
        width: 100%;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .col-date {
        display: none;
    }

    .col-actions {
        width: auto;
    }

    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .explorer-upload-progress {
        width: calc(100% - 2rem);
        left: 1rem;
        right: 1rem;
    }
    
    .context-menu {
        min-width: 150px;
    }
}

/* Checkbox styling */
.item-check,
#checkAll {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Button group in actions */
.col-actions .btn-group {
    justify-content: flex-end;
}

.col-actions .btn-sm {
    padding: 0.3rem 0.5rem;
}

.col-actions .btn-sm .icon-sm {
    width: 14px;
    height: 14px;
}

/* Loading state */
.text-center .spinner {
    margin: 1rem auto;
}

/* Error state */
.text-danger {
    color: var(--danger);
}

/* Empty state */
.text-muted {
    color: var(--text-muted);
}

.py-4 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}
