/* ElbDrive — Custom Styles */

:root {
    --brand-primary:  #2563eb;
    --brand-dark:     #0f172a;
    --brand-light:    #eff6ff;
    --brand-hover:    #1d4ed8;
    --sidebar-width:  240px;
    --topbar-height:  56px;
}

/* ── Global ─────────────────────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
}
a:hover { color: var(--brand-hover); }

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
    background: var(--brand-dark) !important;
    height: var(--topbar-height);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    color: #fff !important;
}
.navbar-brand .brand-icon {
    color: var(--brand-primary);
    margin-right: 6px;
}
.navbar .nav-link {
    color: rgba(255,255,255,0.75) !important;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem !important;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: #fff !important;
}
.navbar .nav-link .bi { margin-right: 4px; }

/* ── Sidebar (optional) ─────────────────────────────────────────────────── */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0 !important;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* ── Quota Bar ──────────────────────────────────────────────────────────── */
.quota-bar { background: #e2e8f0; border-radius: 99px; height: 8px; overflow: hidden; }
.quota-fill { height: 100%; border-radius: 99px; background: var(--brand-primary); transition: width 0.4s; }
.quota-fill.warning { background: #f59e0b; }
.quota-fill.danger  { background: #ef4444; }

/* ── Upload Zone ────────────────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #fafafa;
    color: #64748b;
}
.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--brand-primary);
    background: var(--brand-light);
    color: var(--brand-primary);
}
.upload-zone .bi { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.upload-zone p  { margin: 0; font-size: 0.95rem; }

/* Upload Progress */
.upload-progress-list { margin-top: 1rem; }
.upload-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}
.upload-item .progress { height: 4px; border-radius: 99px; margin-top: 4px; }

/* ── File Table ─────────────────────────────────────────────────────────── */
.file-table { margin: 0; }
.file-table thead th {
    background: #f1f5f9;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.6rem 0.75rem;
    white-space: nowrap;
}
.file-table tbody tr { transition: background 0.1s; }
.file-table tbody tr:hover { background: #f8fafc; }
.file-table td { padding: 0.6rem 0.75rem; vertical-align: middle; border-bottom: 1px solid #f1f5f9; }
.file-table td:last-child { border-bottom: none; }

.file-icon { font-size: 1.3rem; color: #64748b; }
.file-icon.icon-image  { color: #8b5cf6; }
.file-icon.icon-video  { color: #ec4899; }
.file-icon.icon-audio  { color: #10b981; }
.file-icon.icon-pdf    { color: #ef4444; }
.file-icon.icon-code   { color: #0ea5e9; }
.file-icon.icon-zip    { color: #f59e0b; }

.file-name-link { color: #1e293b; font-weight: 500; }
.file-name-link:hover { color: var(--brand-primary); }

.folder-row { cursor: pointer; }
.folder-icon { font-size: 1.3rem; color: #f59e0b; }

/* Action Buttons */
.btn-action {
    background: none;
    border: none;
    padding: 4px 6px;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.btn-action:hover { background: #f1f5f9; color: #1e293b; }
.btn-action.danger:hover { background: #fee2e2; color: #ef4444; }

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.breadcrumb-item a { color: var(--brand-primary); }
.breadcrumb-item.active { color: #64748b; }

/* ── Thumbnail Preview ──────────────────────────────────────────────────── */
.thumb-preview {
    width: 36px; height: 36px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
}

/* ── Dashboard Stats ────────────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: var(--brand-primary); }
.stat-icon.green  { background: #d1fae5; color: #059669; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.orange { background: #ffedd5; color: #ea580c; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: #0f172a; line-height: 1; }
.stat-label { font-size: 0.8rem; color: #64748b; margin-top: 2px; }

/* ── Share Page (s.php) ─────────────────────────────────────────────────── */
.share-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--brand-dark) 0%, #1e3a5f 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
}
.share-box {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}
.share-box .brand { font-size: 1.1rem; font-weight: 700; color: var(--brand-dark); margin-bottom: 1.5rem; }
.share-box .file-icon-big { font-size: 4rem; color: var(--brand-primary); margin-bottom: 1rem; }
.share-box h2 { font-size: 1.2rem; font-weight: 600; color: #1e293b; word-break: break-word; }
.share-box .file-meta { font-size: 0.85rem; color: #64748b; margin-bottom: 1.5rem; }

/* ── Login Page ─────────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--brand-dark) 0%, #1e3a5f 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
}
.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo .bi { font-size: 3rem; color: var(--brand-primary); }
.login-logo h1 { font-size: 1.75rem; font-weight: 800; color: var(--brand-dark); margin: 0.5rem 0 0; }

/* ── Modals ─────────────────────────────────────────────────────────────── */
.modal-header { border-bottom: 1px solid #e2e8f0; }
.modal-footer { border-top: 1px solid #e2e8f0; }

/* ── Copy Link ──────────────────────────────────────────────────────────── */
.copy-link-group input { font-size: 0.85rem; background: #f8fafc; }
.copy-btn { white-space: nowrap; }

/* ── Trash ──────────────────────────────────────────────────────────────── */
.trash-badge {
    background: #fee2e2; color: #ef4444;
    border-radius: 6px; padding: 2px 8px; font-size: 0.75rem; font-weight: 600;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .main-container { padding: 1rem 0.5rem; }
    .stat-card { padding: 1rem; }
    .file-table thead { display: none; }
    .file-table td { display: block; border: none; padding: 0.25rem 0.75rem; }
    .file-table tr { border-bottom: 1px solid #f1f5f9; padding: 0.5rem 0; display: block; }
    .share-box, .login-box { padding: 1.75rem 1.25rem; }
}

/* ── Utilities ──────────────────────────────────────────────────────────── */
.text-muted-sm { font-size: 0.8rem; color: #94a3b8; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }

.btn-primary {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}

.spinner-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
