/**
 * NeonIndex v2.1 — Apple-Inspired Theme System
 *
 * Clean, minimalistic, and strictly 2 themes (Light & Dark).
 * Uses SF Pro Display / System UI fonts and subtle glassmorphism.
 */

:root {
    /* ════ LIGHT THEME (Apple Style) ════ */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #e8e8ed;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-glow: rgba(0, 113, 227, 0.15);
    
    --success: #34c759;
    --danger: #ff3b30;
    --warning: #ff9500;
    
    --border: #d2d2d7;
    --border-highlight: rgba(255, 255, 255, 0.5);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 50px;
    
    --backdrop-blur: blur(20px);
    
    --font-stack: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-bs-theme="dark"] {
    /* ════ DARK THEME (Apple Style) ════ */
    --bg-primary: #1d1d1f;
    --bg-secondary: #2d2d2f;
    --bg-tertiary: #3a3a3c;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --accent: #0A84FF;
    --accent-hover: #409CFF;
    --accent-glow: rgba(10, 132, 255, 0.2);
    
    --border: #48484a;
    --border-highlight: rgba(255, 255, 255, 0.05);
    
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.5);
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. BASE / TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════════════════ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-stack);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

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

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

/* ═══════════════════════════════════════════════════════════════════════════
   3. COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */
.navbar, .topbar {
    background: rgba(var(--bg-secondary), 0.8) !important;
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    padding: 0.8rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Apple prefers bg-primary with border for cards instead of deep shadows for basic cards */
.card {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s var(--ease);
    overflow: hidden;
}

.card-header {
    background: var(--bg-secondary) !important;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    font-weight: 600;
    font-size: 1.05rem;
}

.card-body {
    padding: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. BUTTONS & FORMS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn-accent {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-ghost:hover {
    background: var(--bg-tertiary);
    color: var(--accent-hover);
}

.btn-ghost.text-danger {
    color: var(--danger) !important;
}
.btn-ghost.text-danger:hover {
    background: rgba(255, 59, 48, 0.1);
}

.form-control, .form-select {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border);
    color: var(--text-primary) !important;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s var(--ease);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    background: var(--bg-primary) !important;
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. TABLES & LISTS
   ═══════════════════════════════════════════════════════════════════════════ */
.table {
    color: var(--text-primary);
    margin-bottom: 0;
}
.table th {
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    padding: 0.75rem 1rem;
}
.table td {
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    vertical-align: middle;
}
.table tbody tr {
    transition: background-color 0.15s var(--ease);
}
.table tbody tr:hover {
    background-color: var(--bg-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. MODALS
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-content {
    background: rgba(var(--bg-primary), 0.95);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
}
.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   7. ADMIN SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 210px;
    padding: 0.75rem;
    padding-top: 64px;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 1020;
    background: var(--bg-primary);
}
.sidebar .nav-link {
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.2s var(--ease);
}
.sidebar .nav-link:hover {
    background: var(--bg-tertiary);
}
.sidebar .nav-link.active {
    background: var(--accent);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Helpers */
.text-muted, .text-muted-custom, [style*="color:var(--muted)"], .mu {
    color: var(--text-secondary) !important;
}
.bd {
    border-color: var(--border) !important;
}/* ---------------------------------------------------------------------------
   8. ADMIN LAYOUT SPECIFICS
   --------------------------------------------------------------------------- */
.brand {
    display: flex; align-items: center; gap: 0.5rem; text-decoration: none; font-weight: 700; font-size: 1.05rem; color: var(--accent);
}
.main {
    margin-left: 210px; padding: 1.25rem; padding-top: calc(52px + 1.25rem); min-height: 100vh;
}
.toggle-row {
    display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child {
    border-bottom: none;
}
.toggle-row label {
    font-size: 0.85rem; font-weight: 500; cursor: pointer;
}
.badge {
    font-weight: 500; padding: 0.3em 0.6em; border-radius: 6px; font-size: 0.72rem;
}
[data-bs-theme="dark"] .list-group-item {
    background: transparent; border-color: var(--border); color: var(--text-primary);
}
.login-card {
    max-width: 380px; margin: 8vh auto;
}
.empty-state {
    padding: 2.5rem 1rem; text-align: center; color: var(--text-secondary);
}
.empty-state i {
    font-size: 2.5rem; margin-bottom: 0.5rem; display: block; opacity: 0.4;
}
.tab-pane {
    animation: fadeUp 0.2s var(--ease);
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile Nav for Admin */
@media(max-width: 991px) {
    .sidebar { display: none; }
    .main { margin-left: 0; padding-bottom: 75px; }
    .mob-nav { display: flex !important; }
}
@media(min-width: 992px) {
    .mob-nav { display: none !important; }
}
.mob-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1040; padding: 0.3rem 0.25rem;
    justify-content: space-around; border-top: 1px solid var(--border);
    background: rgba(var(--bg-secondary), 0.9); backdrop-filter: var(--backdrop-blur); -webkit-backdrop-filter: var(--backdrop-blur);
}
.mob-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 0.1rem; font-size: 0.6rem; padding: 0.3rem 0.4rem;
    border-radius: 8px; color: var(--text-secondary); text-decoration: none; font-weight: 500;
}
.mob-nav a.active, .mob-nav a:hover {
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. UPLOAD PROGRESS
   ═══════════════════════════════════════════════════════════════════════════ */
.upload-file-row {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}
.upload-file-row:last-child {
    border-bottom: none;
}
.upload-file-name {
    font-size: 0.82rem;
    word-break: break-all;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.upload-file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}
