/* ==========================================================================
   Legal Intelligence Platform - Master Stylesheet
   Version: 2.0.0
   Description: Modern, consistent theme system with three color templates
   Author: Legal Intelligence Platform Team
   ========================================================================== */

/* ==========================================================================
   CSS Custom Properties (Theme Variables)
   ========================================================================== */

:root {
    /* Light Theme (Default - Cold Gray) */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e9ecef;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #868e96;
    --accent-primary: #4263eb;
    --accent-secondary: #5c7cfa;
    --accent-gradient: linear-gradient(135deg, #4263eb 0%, #5c7cfa 100%);
    --border-color: rgba(33, 37, 41, 0.12);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --hover-bg: rgba(66, 99, 235, 0.06);
    --success-color: #2f9e44;
    --warning-color: #f08c00;
    --error-color: #e03131;
    --nav-bg: rgba(248, 249, 250, 0.95);
    --footer-bg: rgba(233, 236, 239, 0.95);
}

[data-theme="dark"] {
    /* Dark Theme (Slate Blue) */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --border-color: rgba(148, 163, 184, 0.2);
    --card-bg: rgba(30, 41, 59, 0.8);
    --card-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    --hover-bg: rgba(99, 102, 241, 0.1);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --nav-bg: rgba(15, 23, 42, 0.95);
    --footer-bg: rgba(15, 23, 42, 0.95);
}

[data-theme="bright"] {
    /* Bright Theme (Sky Blue) */
    --bg-primary: #ffffff;
    --bg-secondary: #f0f9ff;
    --bg-tertiary: #e0f2fe;
    --text-primary: #0c4a6e;
    --text-secondary: #0369a1;
    --text-muted: #7dd3fc;
    --accent-primary: #0284c7;
    --accent-secondary: #0ea5e9;
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    --border-color: rgba(2, 132, 199, 0.3);
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-shadow: 0 10px 40px rgba(2, 132, 199, 0.15);
    --hover-bg: rgba(2, 132, 199, 0.1);
    --success-color: #0891b2;
    --warning-color: #f59e0b;
    --error-color: #ea580c;
    --nav-bg: rgba(240, 249, 255, 0.95);
    --footer-bg: rgba(224, 242, 254, 0.95);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-secondary);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1rem;
}

/* ==========================================================================
   Navigation
   ========================================================================== */

.main-nav {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.75rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-brand:hover {
    opacity: 0.9;
}

.nav-logo {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover,
.nav-link.active {
    background: var(--hover-bg);
    color: var(--accent-primary);
}

.nav-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ==========================================================================
   Theme Toggle
   ========================================================================== */

.theme-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: 8px;
}

.theme-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.theme-btn:hover {
    background: var(--hover-bg);
    color: var(--accent-primary);
}

.theme-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--hover-bg);
    border-color: var(--accent-primary);
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    opacity: 0.9;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--accent-gradient);
    color: white;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.card-body {
    padding: 1rem 0;
}

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--hover-bg);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.form-error {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.main-footer {
    background: var(--footer-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-section h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section p,
.footer-section a {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.footer-section a {
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Server Status Indicators
   ========================================================================== */

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: monospace;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s ease;
}

.status-indicator.online .status-dot {
    background: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
}

.status-indicator.offline .status-dot {
    background: var(--error-color);
}

.status-indicator.checking .status-dot {
    background: var(--warning-color);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.main-content {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ==========================================================================
   Grid Layouts
   ========================================================================== */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }
.form-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.form-field > label { font-weight: 600; color: var(--text-secondary); }
.switch-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; cursor: pointer; }
.switch-label input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent-primary); }.text-accent { color: var(--accent-primary); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-error { color: var(--error-color); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden { display: none !important; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .nav-container {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.4rem 0.65rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 768px) {
    html { font-size: 14px; }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .theme-toggle {
        order: -1;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .main-content {
        padding: 1.5rem 1rem;
    }
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-wide {
    max-width: 700px;
}

.modal-header {
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(47, 158, 68, 0.1);
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
}

.alert-warning {
    background: rgba(240, 140, 0, 0.1);
    border-left: 4px solid var(--warning-color);
    color: var(--warning-color);
}

.alert-error {
    background: rgba(224, 49, 49, 0.1);
    border-left: 4px solid var(--error-color);
    color: var(--error-color);
}

.alert-info {
    background: rgba(66, 99, 235, 0.1);
    border-left: 4px solid var(--accent-primary);
    color: var(--accent-primary);
}

/* ==========================================================================
   Tables
   ========================================================================== */

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
}

.table tr:hover {
    background: var(--hover-bg);
}

.table tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Badges & Tags
   ========================================================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: rgba(66, 99, 235, 0.1);
    color: var(--accent-primary);
}

.badge-success {
    background: rgba(47, 158, 68, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(240, 140, 0, 0.1);
    color: var(--warning-color);
}

.badge-error {
    background: rgba(224, 49, 49, 0.1);
    color: var(--error-color);
}

/* ==========================================================================
   Progress Bar
   ========================================================================== */

.progress {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .main-nav,
    .main-footer,
    .theme-toggle,
    .btn,
    .modal-overlay {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* ==========================================================================
   User Badge (nav)
   ========================================================================== */
.nav-user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    background: var(--bg-tertiary);
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.nav-user-badge .user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ==========================================================================
   Dropdown Menu
   ========================================================================== */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 0.5rem;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}
.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
}
.dropdown-item:hover {
    background: var(--hover-bg);
    color: var(--accent-primary);
}
.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.375rem 0;
}
.dropdown-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0.375rem 0.75rem;
}

/* ==========================================================================
   Settings Panel (modal-based)
   ========================================================================== */
.settings-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.settings-tab {
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.settings-tab:hover { color: var(--accent-primary); }
.settings-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}
.settings-panel { display: none; }
.settings-panel.active { display: block; }

/* ==========================================================================
   Tab Navigation (page-level tabs)
   ========================================================================== */
.page-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
}
.page-tab {
    padding: 0.75rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: all 0.2s;
}
.page-tab:hover { color: var(--accent-primary); }
.page-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.empty-state-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Code Block
   ========================================================================== */
.code-block {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    color: var(--text-primary);
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 3000;
    max-width: 400px;
    animation: toastSlide 0.3s ease;
}
@@keyframes toastSlide {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.toast-success { border-left: 4px solid var(--success-color); }
.toast-error { border-left: 4px solid var(--error-color); }
.toast-warning { border-left: 4px solid var(--warning-color); }
.toast-info { border-left: 4px solid var(--accent-primary); }

/* Dropdown menu right alignment (for user dropdown) */
.dropdown-menu-right {
    right: 0;
    left: auto;
}

/* Theme dropdown items */
.dropdown-theme .dropdown-menu {
    min-width: 140px;
}
.dropdown-theme .theme-btn {
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
}
.dropdown-theme .theme-btn.active {
    background: var(--hover-bg);
    color: var(--accent-primary);
    font-weight: 600;
}

/* User dropdown */
.dropdown-user .nav-user-badge {
    cursor: pointer;
}
.dropdown-user .dropdown-menu {
    min-width: 180px;
}
