:root {
    --primary-color: #0f172a;
    --primary-light: #1e293b;
    --accent-color: #d4af37;
    --accent-hover: #b8962e;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --text-light: #f8fafc;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;

    /* Syncfusion Variable Overrides - Light Mode */
    --sf-primary: var(--accent-color);
    --sf-primary-hover: var(--accent-hover);
    --sf-primary-text: var(--white);
    --sf-content-text: var(--text-dark);
    --sf-content-bg: var(--white);
    --sf-grid-header-bg: var(--primary-color);
    --sf-grid-header-text-color: var(--white);
    --sf-toolbar-bg: var(--primary-color);
    --sf-toolbar-text: var(--white);
    --sf-sidebar-bg: var(--primary-color);
    --sf-sidebar-text: var(--text-light);
}

html, body {
    font-family: 'Cairo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

.btn-primary {
    color: var(--primary-color);
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    font-weight: 600;
}

.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
    color: var(--primary-color);
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

.e-btn .e-btn-icon {
    margin-inline: 0.35rem;
}
.e-btn .e-icon-left {
    margin-inline-end: 0.35rem;
}
.e-btn .e-icon-right {
    margin-inline-start: 0.35rem;
}
.btn i,
.e-btn i,
.badge i {
    margin-inline: 0.35rem;
}

.custom-btn-primary,
.e-btn.custom-btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--accent-color) !important;
    color: var(--white) !important;
}

.content {
    padding-top: 1.1rem;
}

/* Accent color utility */
.text-accent {
    color: var(--accent-color) !important;
}

/* Icon-text alignment utility (works RTL/LTR) */
.icon-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
[dir="rtl"] .icon-text {
    flex-direction: row-reverse;
    justify-content: flex-start;
    gap: 0.5rem;
}

/* Hearings Card Styling */
.hearing-card-header .badge {
    border-radius: 999px;
    padding: 0.25rem 0.5rem;
}
.hearing-card-positive {
    border-left: 4px solid #198754; /* Bootstrap success */
}
.hearing-card-negative {
    border-left: 4px solid #dc3545; /* Bootstrap danger */
}
.hearing-card-neutral {
    border-left: 4px solid #0dcaf0; /* Bootstrap info */
}
.hearing-card-pending {
    border-left: 4px solid #6c757d; /* Bootstrap secondary */
}
.hearing-card.compact .card-body {
    padding: 0.5rem 0.75rem !important;
}
.hearing-card .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hearing-card .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.08);
}

/* Pills for details chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background-color: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid rgba(0,0,0,.12);
    font-size: .85rem;
}
[data-bs-theme="dark"] .chip {
    background-color: #1e293b;
    color: #f8fafc;
    border-color: #475569;
}
.chip i {
    opacity: .8;
}

/* Clamp long text blocks */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Timeline line color (light/dark) */
.hearing-timeline-line {
    background-color: rgba(0,0,0,.08);
}
[data-bs-theme="dark"] .hearing-timeline-line {
    background-color: rgba(255,255,255,.15);
}

/* Theme-aware surface helpers (in case Bootstrap tokens are missing or inconsistent) */
.bg-body-secondary {
    background-color: var(--bg-light) !important;
    color: var(--text-dark) !important;
}
[data-bs-theme="dark"] .bg-body-secondary {
    background-color: #1f2937 !important; /* Slate 800 */
    color: #f8fafc !important;
    border-color: #475569 !important;
}
.text-body {
    color: var(--text-dark) !important;
}
[data-bs-theme="dark"] .text-body {
    color: #f8fafc !important;
}
[data-bs-theme="dark"] .avatar-circle {
    background-color: #1e293b !important;
    border-color: #475569 !important;
}

/* Custom Overrides for Syncfusion Components to match stylish theme */
.e-appbar.e-primary {
    background: var(--primary-color) !important;
    color: var(--white) !important;
    box-shadow: var(--shadow);
}

.e-sidebar {
    background-color: var(--white) !important; /* Sidebar white, content dark/light */
    border-right: 1px solid rgba(0,0,0,0.12);
}

[dir="rtl"] .e-grid .e-pager .e-pager-size,
.e-grid .e-pager .e-pager-size,
.e-grid .e-pager .e-pagesizes,
.e-grid .e-pager .e-pager-dropdown,
.e-grid .e-pager .e-pager-sizes {
    display: none !important;
}

[dir="rtl"] .e-sidebar {
    border-right: none;
    border-left: 1px solid rgba(0,0,0,0.12);
}

/* Dark Mode Overrides */
[data-bs-theme="dark"] {
    --primary-color: #0f172a; /* Keep brand color */
    --bg-light: #020617;
    --text-dark: #f8fafc;
    --text-gray: #94a3b8;
    --white: #1e293b; /* Card bg in dark mode */
    
    --sf-content-bg: #0f172a;
    --sf-content-text: #f8fafc;
    --sf-grid-content-bg: #1e293b;
    --sf-grid-content-text: #f8fafc;
}

/* Fix btn-light and Syncfusion buttons in dark mode */
[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .e-btn.btn-light {
    background-color: #334155; /* Slate 700 - Visible against Slate 800/900 */
    border-color: #334155;
    color: #f8fafc !important; /* Force white text */
}

[data-bs-theme="dark"] .btn-light:hover,
[data-bs-theme="dark"] .e-btn.btn-light:hover {
    background-color: #475569; /* Slate 600 */
    border-color: #475569;
    color: #ffffff !important;
}

/* Fix standard Syncfusion buttons in dark mode */
[data-bs-theme="dark"] .e-btn:not(.e-primary):not(.e-link):not(.btn-light):not(.e-flat) {
    background-color: #334155;
    border-color: #334155;
    color: #f8fafc;
}

[data-bs-theme="dark"] .e-btn:not(.e-primary):not(.e-link):not(.btn-light):not(.e-flat):hover {
    background-color: #475569;
    border-color: #475569;
    color: #ffffff;
}

[data-bs-theme="dark"] .e-input-group,
[data-bs-theme="dark"] .e-input-group input.e-input,
[data-bs-theme="dark"] .e-input {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}
[data-bs-theme="dark"] input::placeholder,
[data-bs-theme="dark"] textarea::placeholder {
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] .e-multiselect .e-chips,
[data-bs-theme="dark"] .e-multiselect .e-chip,
[data-bs-theme="dark"] .e-multiselect .e-input-token {
    background-color: #334155 !important;
    color: #f8fafc !important;
    border-color: #475569 !important;
}
[data-bs-theme="dark"] .e-dropdownbase .e-content,
[data-bs-theme="dark"] .e-popup,
[data-bs-theme="dark"] .e-datepicker,
[data-bs-theme="dark"] .e-calendar {
    background-color: #1e293b !important;
    color: #f8fafc !important;
}
[data-bs-theme="dark"] .e-dropdownbase .e-list-item:hover {
    background-color: #475569 !important;
    color: #ffffff !important;
}

/* Fix custom primary buttons in dark mode */
[data-bs-theme="dark"] .custom-btn-primary,
[data-bs-theme="dark"] .e-btn.e-primary.custom-btn-primary {
    background-color: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
    color: var(--primary-color) !important;
}

[data-bs-theme="dark"] .custom-btn-primary:hover,
[data-bs-theme="dark"] .e-btn.e-primary.custom-btn-primary:hover {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    color: var(--primary-color) !important;
}

/* Loading Indicator */

/* Ensure muted text follows theme palette for readability */
.text-muted {
    color: var(--text-gray) !important;
}

.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.logo-wrapper {
    margin-bottom: 2rem;
    animation: pulse 2s infinite ease-in-out;
}

.loading-logo {
    width: 120px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.3));
}

.spinner {
    width: 70px;
    text-align: center;
}

.spinner > div {
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 100%;
    display: inline-block;
    animation: sk-bouncedelay 1.4s infinite ease-in-out both;
    margin: 0 2px;
}

.spinner .bounce1 {
    animation-delay: -0.32s;
}

.spinner .bounce2 {
    animation-delay: -0.16s;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.9; }
}

@keyframes sk-bouncedelay {
    0%, 80%, 100% { 
        transform: scale(0);
    } 40% { 
        transform: scale(1.0);
    }
}
