/* =====================================================
   DocIndia Admin — Base Styles
   Loaded on EVERY page via _ModernAdminLayout.cshtml
   Contains: CSS variables, reset, typography,
             brand logo, theme toggle
   ===================================================== */

/* ── 1. THEME VARIABLES ─────────────────────────────── */
:root,
[data-theme="light"] {
    --surface-page:        #f0f4f8;
    --surface-card:        #ffffff;
    --surface-subtle:      #f8fafc;
    --border-default:      #e2e8f0;
    --border-focus:        #3b82f6;

    --text-primary:        #0f172a;
    --text-secondary:      #475569;
    --text-muted:          #94a3b8;
    --text-inverse:        #ffffff;

    --brand-primary:       #2563eb;
    --brand-hover:         #1d4ed8;
    --brand-subtle:        #eff6ff;
    --accent:              #10b981;

    --panel-bg:            linear-gradient(150deg, #0f172a 0%, #1e3a5f 60%, #0f2d50 100%);

    --input-bg:            #ffffff;
    --input-border:        #d1d5db;
    --input-text:          #0f172a;
    --input-label:         #64748b;
    --input-label-active:  #3b82f6;

    --shadow-btn:          0 4px 14px rgba(37, 99, 235, 0.35);

    --error-bg:            #fef2f2;
    --error-border:        #fecaca;
    --error-text:          #dc2626;
}

[data-theme="dark"] {
    --surface-page:        #0b0f1a;
    --surface-card:        #131928;
    --surface-subtle:      #1a2236;
    --border-default:      #1e2d45;
    --border-focus:        #3b82f6;

    --text-primary:        #f1f5f9;
    --text-secondary:      #94a3b8;
    --text-muted:          #475569;
    --text-inverse:        #ffffff;

    --brand-primary:       #3b82f6;
    --brand-hover:         #2563eb;
    --brand-subtle:        rgba(59, 130, 246, 0.12);

    --panel-bg:            linear-gradient(150deg, #070b14 0%, #0f1f38 60%, #091929 100%);

    --input-bg:            #1a2236;
    --input-border:        #1e2d45;
    --input-text:          #f1f5f9;
    --input-label:         #64748b;
    --input-label-active:  #60a5fa;

    --shadow-btn:          0 4px 14px rgba(59, 130, 246, 0.4);

    --error-bg:            rgba(220, 38, 38, 0.1);
    --error-border:        rgba(220, 38, 38, 0.3);
    --error-text:          #f87171;
}

/* ── 2. RESET & BASE ────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--surface-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
}

a { color: var(--brand-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; display: block; }

/* ── 3. BRAND LOGO ──────────────────────────────────── */
.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.brand-logo__img {
    display: block;
    width: auto;
    transition: filter 0.3s ease;
}

.brand-logo__badge {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.2);
    white-space: nowrap;
    transition: all 0.3s ease;
}

/* Logo on dark backgrounds */
.brand-logo--on-dark .brand-logo__img   { filter: brightness(0) invert(1); }
.brand-logo--on-dark .brand-logo__badge {
    background: rgba(255, 255, 255, 0.1);
    color: #93c5fd;
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .brand-logo__img   { filter: brightness(0) invert(1); }
[data-theme="dark"] .brand-logo__badge {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.25);
}

/* ── 4. THEME TOGGLE ────────────────────────────────── */
.theme-toggle {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-default);
    background: var(--surface-subtle);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all 0.2s;
    outline: none;
}

.theme-toggle:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    transform: rotate(20deg);
}

/* ── 5. UTILITIES ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: var(--brand-primary); color: #fff; }
