/**
 * Regulatory Intelligence - Shared CSS Variables
 * All colors are defined here and used across the entire application.
 */

:root {
    /* ========================================
       Background Colors (Dark Theme)
       ======================================== */
    --bg-primary: #0f172a;          /* Main background - slate-900 */
    --bg-secondary: #1e293b;        /* Cards, inputs, modals - slate-800 */
    --bg-tertiary: #334155;         /* Hover states, borders - slate-700 */
    --bg-disabled: #475569;         /* Disabled buttons - slate-600 */
    
    /* ========================================
       Text Colors
       ======================================== */
    --text-primary: #e2e8f0;        /* Main text - slate-200 */
    --text-bright: #f8fafc;         /* Headings, emphasis - slate-50 */
    --text-secondary: #94a3b8;      /* Secondary text - slate-400 */
    --text-muted: #64748b;          /* Muted, placeholders - slate-500 */
    
    /* ========================================
       Border Colors
       ======================================== */
    --border-primary: #334155;      /* Default borders - slate-700 */
    --border-light: #475569;        /* Lighter borders - slate-600 */
    
    /* ========================================
       Brand / Accent Colors
       ======================================== */
    --primary-blue: #1e40af;        /* Primary blue - blue-800 */
    --accent-primary: #38bdf8;      /* Primary accent (cyan) - sky-400 */
    --accent-light: #7dd3fc;        /* Light accent (hover) - sky-300 */
    --accent-blue: #3b82f6;         /* Button blue - blue-500 */
    --accent-blue-hover: #2563eb;   /* Button blue hover - blue-600 */
    --accent-blue-dark: #1e3a5f;    /* Dark blue background */
    --accent-blue-light: #93c5fd;   /* Light blue text - blue-300 */
    
    /* ========================================
       Status Colors - Success
       ======================================== */
    --success: #22c55e;             /* Success primary - green-500 */
    --success-light: #4ade80;       /* Success light - green-400 */
    --success-bg: rgba(34, 197, 94, 0.1);
    --success-bg-strong: rgba(34, 197, 94, 0.2);
    --success-bg-stronger: rgba(34, 197, 94, 0.3);
    --success-border: rgba(34, 197, 94, 0.5);
    
    /* ========================================
       Status Colors - Error
       ======================================== */
    --error: #ef4444;               /* Error primary - red-500 */
    --error-light: #f87171;         /* Error light - red-400 */
    --error-lighter: #fca5a5;       /* Error lighter - red-300 */
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-bg-strong: rgba(239, 68, 68, 0.2);
    --error-bg-stronger: rgba(239, 68, 68, 0.3);
    --error-border: rgba(239, 68, 68, 0.3);
    --error-border-strong: rgba(239, 68, 68, 0.5);
    
    /* ========================================
       Status Colors - Warning
       ======================================== */
    --warning: #f59e0b;             /* Warning primary - amber-500 */
    --warning-bg: rgba(245, 158, 11, 0.2);
    
    /* ========================================
       Status Colors - Info
       ======================================== */
    --info: #38bdf8;                /* Info primary - sky-400 */
    --info-light: #7dd3fc;          /* Info light - sky-300 */
    --info-bg: rgba(56, 189, 248, 0.1);
    --info-border: rgba(56, 189, 248, 0.3);
    
    /* ========================================
       Overlay / Shadow
       ======================================== */
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --shadow-glow: rgba(255, 255, 255, 0.3);
    --shadow-dark: rgba(0, 0, 0, 0.5);
    --hover-overlay: rgba(0, 0, 0, 0.05);
    --blue-tint-bg: rgba(37, 99, 235, 0.1);
    --spinner-white: rgba(255, 255, 255, 0.3);
    
    /* ========================================
       White overlays (for dark backgrounds)
       ======================================== */
    --white-text: rgba(255, 255, 255, 0.85);
    --white-hover: rgba(255, 255, 255, 0.1);
    --white-active: rgba(255, 255, 255, 0.15);
    
    /* ========================================
       Spinner
       ======================================== */
    --spinner-track: rgba(15, 23, 42, 0.3);
    
    /* ========================================
       Browser Dots (macOS style)
       ======================================== */
    --dot-red: #ff5f57;
    --dot-yellow: #ffbd2e;
    --dot-green: #28c840;
}


/* ============================================
   Common Reset & Base Styles
   ============================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
}


/* ============================================
   Navigation Bar (Shared)
   ============================================ */

.navbar {
    background: var(--primary-blue);
    padding: 0;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 52px;
}

.navbar-brand {
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
    padding: 0.875rem 1.5rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: -0.01em;
}

.navbar-brand svg {
    width: 24px;
    height: 24px;
}

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

.navbar-nav a {
    color: var(--white-text);
    text-decoration: none;
    padding: 0.95rem 1.1rem;
    display: block;
    font-size: 0.9375rem;
    font-weight: 400;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.navbar-nav a:hover {
    background: var(--white-hover);
    color: white;
}

.navbar-nav a.active {
    background: var(--white-active);
    color: white;
    font-weight: 600;
}

/* Logout button - pushed to far right */
.nav-logout {
    margin-left: auto;
}

.nav-logout a {
    display: flex !important;
    align-items: center;
    gap: 0.45rem;
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.8125rem !important;
    padding: 0.95rem 1.5rem !important;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.2s, color 0.2s;
}

.nav-logout a:hover {
    color: white !important;
    background: rgba(239, 68, 68, 0.25) !important;
}

.nav-logout a svg {
    opacity: 0.7;
    flex-shrink: 0;
}

.nav-logout a:hover svg {
    opacity: 1;
}

/* Hamburger toggle button - hidden on desktop */
.navbar-toggler {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 1rem 1.25rem;
    margin-left: auto;
    flex-direction: column;
    gap: 5px;
}

.navbar-toggler span {
    display: block;
    width: 24px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* ---- Responsive / Mobile ---- */
@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
    }

    .navbar-toggler {
        display: flex;
    }

    .navbar-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--primary-blue);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar-nav.open {
        display: flex;
    }

    .navbar-nav li {
        width: 100%;
    }

    .navbar-nav a {
        padding: 0.9rem 1.5rem;
        font-size: 0.9375rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-logout {
        margin-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    .nav-logout a {
        border-left: none !important;
        padding: 0.9rem 1.5rem !important;
    }
}


/* ============================================
   Footer (Shared - Argus-style)
   ============================================ */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    margin-top: auto;
}

.footer-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.footer-brand svg {
    color: var(--accent-primary);
    flex-shrink: 0;
}

.footer-brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: -0.01em;
}

.footer-slogan {
    font-size: 0.9375rem;
    color: var(--accent-primary);
    font-weight: 500;
    margin-bottom: 1.25rem;
    padding-left: 2.15rem;
    font-style: italic;
}

.footer-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 700px;
    padding-left: 2.15rem;
}

.footer-bottom {
    border-top: 1px solid var(--border-primary);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    max-width: 1200px;
    margin: 0 auto;
}

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

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    display: flex;
    align-items: center;
}

.footer-links li:not(:last-child)::after {
    content: "·";
    color: var(--text-muted);
    margin: 0 0.5rem;
    font-size: 0.8rem;
}

.footer-links a {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* Footer mobile */
@media (max-width: 768px) {
    .footer-main {
        padding: 2rem 1.25rem 1.5rem;
    }

    .footer-slogan,
    .footer-description {
        padding-left: 0;
    }

    .footer-bottom {
        padding: 1rem 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .footer-links {
        gap: 0.15rem;
    }
}


/* ============================================
   Common Form Elements
   ============================================ */

.filter-input,
.filter-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filter-input::placeholder {
    color: var(--text-muted);
}


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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.badge-true {
    background: var(--success-bg-strong);
    color: var(--success);
}

.badge-false {
    background: var(--error-bg-strong);
    color: var(--error);
}

.badge-empty {
    background: rgba(100, 116, 139, 0.2);
    color: var(--text-muted);
}


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

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-light);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-blue {
    background: var(--accent-blue);
    color: white;
}

.btn-blue:hover:not(:disabled) {
    background: var(--accent-blue-hover);
}


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

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-primary);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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


/* ============================================
   Modal Styles (Shared)
   ============================================ */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.visible {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 25px 50px -12px var(--shadow-dark);
}
