/* ==========================================
   KURBANPRO - PREMIUM GLOBAL THEME SYSTEM
   ========================================== */

/* Light/Default Theme Variables */
:root {
    --bs-body-bg: #f8fafc;
    --bs-body-color: #334155;
    --bs-heading-color: #0f172a;
    --bs-card-bg: #ffffff;
    --bs-border-color: #e2e8f0;
    
    /* Layout Variables */
    --bb-header-bg: #ffffff;
    --bb-sidebar-bg: #1e1b4b;
    --bb-sidebar-color: #ffffff;
    --bb-card-shadow: 0 10px 25px rgba(2, 8, 23, 0.03);
}

/* Aggressive theme variables for bootstrap theme framework */
body {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--bs-heading-color) !important;
}

/* ==========================================
   ULTIMATE DARK THEME OVERRIDES (PREMIUM)
   ========================================== */
body.dark-theme {
    --bs-body-bg: #0b0f19; /* Deeper slate dark */
    --bs-body-color: #94a3b8;
    --bs-heading-color: #f1f5f9;
    --bs-card-bg: #111827; /* Rich dark card background */
    --bs-border-color: #1f2937;
    
    /* Layout Variables */
    --bb-header-bg: #111827;
    --bb-sidebar-bg: #090d16;
    --bb-sidebar-color: #cbd5e1;
    --bb-card-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);

    /* Text Colors override for basic text tags to guarantee readability */
    color: #94a3b8 !important;
    background-color: #0b0f19 !important;
}

/* Modern Card & Component Polish in Dark Theme */
body.dark-theme .kpro-card, 
body.dark-theme .bb-grid-card,
body.dark-theme .bb-kpi-card,
body.dark-theme .section-card,
body.dark-theme .modal-content {
    background-color: var(--bs-card-bg) !important;
    border-color: var(--bs-border-color) !important;
    box-shadow: var(--bb-card-shadow) !important;
}

/* Header & Sidebar overrides in Dark Mode */
body.dark-theme .app-header {
    background-color: var(--bb-header-bg) !important;
    border-color: var(--bs-border-color) !important;
}

body.dark-theme .app-sidebar {
    background-color: var(--bb-sidebar-bg) !important;
    border-color: var(--bs-border-color) !important;
}

/* Text Accent Overrides for Premium Contrast in Dark Theme */
body.dark-theme .text-success, 
body.dark-theme .text-success-darker,
body.dark-theme .val.success {
    color: #4ade80 !important; /* Premium Neon Green */
}

body.dark-theme .text-danger, 
body.dark-theme .text-danger-dark,
body.dark-theme .val.danger {
    color: #f87171 !important; /* Premium Neon Red */
}

body.dark-theme .text-warning {
    color: #fbbf24 !important; /* Amber Yellow */
}

body.dark-theme .text-info {
    color: #22d3ee !important; /* Soft Cyan */
}

body.dark-theme .text-primary {
    color: #60a5fa !important; /* Ice Blue */
}

body.dark-theme .text-muted {
    color: #64748b !important;
}

/* Badges styling in Dark Mode (High Contrast & Glowing) */
body.dark-theme .badge.bg-success, 
body.dark-theme .bg-success.bg-opacity-10 {
    background-color: rgba(74, 222, 128, 0.1) !important;
    color: #4ade80 !important;
    border: 1px solid rgba(74, 222, 128, 0.2);
}

body.dark-theme .badge.bg-danger, 
body.dark-theme .bg-danger.bg-opacity-10 {
    background-color: rgba(248, 113, 113, 0.1) !important;
    color: #f87171 !important;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

body.dark-theme .badge.bg-primary, 
body.dark-theme .bg-primary.bg-opacity-10 {
    background-color: rgba(96, 165, 250, 0.1) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(96, 165, 250, 0.2);
}

body.dark-theme .badge.bg-warning, 
body.dark-theme .bg-warning.bg-opacity-10 {
    background-color: rgba(251, 191, 36, 0.1) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Grid Specific Row highlights */
body.dark-theme .e-grid .e-row.row-green td,
body.dark-theme .table tr.row-green td {
    background-color: rgba(74, 222, 128, 0.03) !important;
    color: #cbd5e1 !important;
}

body.dark-theme .e-grid .e-row.row-red td,
body.dark-theme .table tr.row-red td {
    background-color: rgba(248, 113, 113, 0.03) !important;
    color: #cbd5e1 !important;
}

body.dark-theme .e-grid .e-row.row-green:hover td,
body.dark-theme .table tr.row-green:hover td {
    background-color: rgba(74, 222, 128, 0.08) !important;
}

body.dark-theme .e-grid .e-row.row-red:hover td,
body.dark-theme .table tr.row-red:hover td {
    background-color: rgba(248, 113, 113, 0.08) !important;
}

/* Pager, Buttons, inputs inside Dark theme */
body.dark-theme input:not([type="button"]):not([type="submit"]):not([type="reset"]),
body.dark-theme textarea,
body.dark-theme select,
body.dark-theme .e-textbox,
body.dark-theme .e-input {
    background-color: #111827 !important;
    color: #cbd5e1 !important;
    border-color: #374151 !important;
    border-radius: 8px;
}

body.dark-theme input:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15) !important;
}

/* Syncfusion Grid Dark Theme Alignment */
body.dark-theme .e-grid {
    background-color: var(--bs-card-bg) !important;
    border-color: var(--bs-border-color) !important;
}

body.dark-theme .e-grid .e-gridheader,
body.dark-theme .e-grid .e-headercell {
    background-color: #1f2937 !important;
    color: #f1f5f9 !important;
    border-color: var(--bs-border-color) !important;
}

body.dark-theme .e-grid .e-headercell .e-headertext {
    color: #f1f5f9 !important;
    font-weight: 700 !important;
}

body.dark-theme .e-grid .e-rowcell {
    color: #cbd5e1 !important;
    border-color: var(--bs-border-color) !important;
    background-color: var(--bs-card-bg) !important;
}

body.dark-theme .e-grid .e-altrow td {
    background-color: #182235 !important;
}

/* Modals & Dialogs Opaque Backing */
body.dark-theme .modal-content, 
body.dark-theme .bb-modal-content {
    background-color: #111827 !important;
    border: 1px solid #1f2937 !important;
    color: #cbd5e1 !important;
}

body.dark-theme .modal-header {
    border-bottom: 1px solid #1f2937 !important;
    background: #0b0f19 !important;
}

body.dark-theme .modal-footer {
    border-top: 1px solid #1f2937 !important;
}

/* Scrollbar customization */
body.dark-theme ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #0b0f19;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 99px;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #374151;
}

/* Dropdowns, Context Menus & Tooltips */
body.dark-theme .dropdown-menu,
body.dark-theme .e-contextmenu-wrapper ul,
body.dark-theme .e-dropdown-popup {
    background-color: #111827 !important;
    border: 1px solid #1f2937 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
}

body.dark-theme .dropdown-item,
body.dark-theme .e-contextmenu-wrapper li {
    color: #cbd5e1 !important;
}

body.dark-theme .dropdown-item:hover,
body.dark-theme .e-contextmenu-wrapper li.e-menu-item.e-focused {
    background-color: #1f2937 !important;
    color: #f1f5f9 !important;
}

body.dark-theme .dropdown-divider {
    border-top-color: #1f2937 !important;
}

/* Defter No badge states in Dark Mode */
body.dark-theme .bb-order-badge {
    background: #1f2937 !important;
    color: #cbd5e1 !important;
}

body.dark-theme .btn-light {
    background-color: #1f2937 !important;
    color: #cbd5e1 !important;
    border-color: #374151 !important;
}

body.dark-theme .btn-light:hover {
    background-color: #374151 !important;
    color: #f1f5f9 !important;
}
