/* theme-red-modern.css - Influenced by cat_spcl_sfdgsf Modern UI */

:root {
    --primary-color: #c12035; /* Red */
    --secondary-color: #273f89; /* Blue */
    --accent-color: #ffd700;
    --bg-light: #f8f9fa;
    --text-dark: #343a40;
    --text-muted: #6c757d;
    --border-radius: 12px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.1);
    
    /* Override Azia Variables */
    --primary: #273f89;
    --primary-hover: #1a2b6d;
}

/* Global Font & Sticky Footer Layout */
html {
    height: 100% !important;
}
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
    position: relative !important;
    min-height: 100vh !important;
    padding-bottom: 40px !important; /* height of footer */
    margin: 0 !important;
}

.az-footer {
    position: absolute !important;
    bottom: 0;
    width: 100%;
}

/* Header Gradient */
.az-header {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    border-bottom: none !important;
    color: white !important;
}

.az-header .az-logo {
    color: white !important;
}
.az-header .az-logo span {
    color: var(--accent-color) !important;
}

@media (min-width: 992px) {
    /* Top level nav links */
    .az-header-menu > .nav > .nav-item > .nav-link {
        color: rgba(255, 255, 255, 0.8) !important;
        font-weight: 600;
    }

    .az-header-menu > .nav > .nav-item.active > .nav-link,
    .az-header-menu > .nav > .nav-item > .nav-link:hover {
        color: white !important;
    }
    
    /* Submenu links */
    .az-menu-sub .nav-link {
        color: var(--text-dark) !important;
        font-weight: normal;
    }
    
    .az-menu-sub .nav-link:hover {
        color: var(--primary-color) !important;
    }
}

/* For mobile menu, ensure text is readable */
@media (max-width: 991px) {
    .az-header-menu .nav-link {
        color: var(--text-dark) !important;
    }
    .az-header-menu .nav-item.active .nav-link,
    .az-header-menu .nav-link:hover {
        color: var(--primary-color) !important;
    }
}

.az-header-menu .nav-item.active .nav-link::before {
    background-color: var(--accent-color) !important;
}

/* Button Behavior (Matches modern.css but Flat) */
.btn-primary, .btn-az-primary {
    background-color: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    border-radius: 0 !important;
    padding: 0.375rem 2rem !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 10px rgba(39, 63, 137, 0.3) !important;
    transition: all 0.3s ease !important;
    color: #fff !important;
}

.btn-primary:hover, .btn-az-primary:hover {
    background-color: #1a2b6d !important;
    border-color: #1a2b6d !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(39, 63, 137, 0.4) !important;
}

/* Form Controls (Matches st.css / modern.css but Flat) */
.form-control, .form-select {
    border-radius: 0 !important;
    background: #f8f9fa !important;
    font-weight: bold !important;
    color: #383d41 !important;
    border: 1px solid #ced4da !important;
    padding: 0.375rem 0.75rem !important;
    transition: all 0.2s ease !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color) !important;
    box-shadow: 0 0 0 0.25rem rgba(39, 63, 137, 0.15) !important;
}

input::placeholder {
    color: rgb(155, 69, 47) !important;
}

/* General Styling */
a {
    color: var(--secondary-color);
}
a:hover {
    color: var(--primary-color);
}

.text-primary {
    color: var(--secondary-color) !important;
}

/* Dark Mode Overrides (Preserving User Toggle) */
body.dark-mode {
    background-color: #121212 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .az-content {
    background-color: #121212 !important;
}
body.dark-mode .card,
body.dark-mode .card-header,
body.dark-mode .card-body {
    background-color: #1e1e1e !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

/* Footer Dark Mode */
body.dark-mode .az-footer {
    background-color: #1e1e1e !important;
    border-top: 1px solid #333 !important;
    color: #e0e0e0 !important;
}
body.dark-mode .az-footer .text-muted {
    color: #a0a0a0 !important;
}

body.dark-mode .form-control {
    background-color: #2b2b2b !important;
    border-color: #444 !important;
    color: #fff !important;
}
body.dark-mode input::placeholder {
    color: #ff9d85 !important; /* Lighter red for dark mode */
}
#darkModeBtn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 10px;
    font-size: 1.2rem;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
}
#darkModeBtn:hover {
    color: white;
    transform: scale(1.1);
}
body.dark-mode #darkModeBtn {
    color: #ffd700; /* Make it a gold sun when in dark mode */
}

/* DataTables & Striped Tables Dark Mode Fixes */
body.dark-mode .table,
body.dark-mode .dataTable {
    color: #e0e0e0 !important;
    background-color: transparent !important;
}

body.dark-mode .table th,
body.dark-mode .table td,
body.dark-mode .dataTable th,
body.dark-mode .dataTable td {
    border-color: #333 !important;
    color: #e0e0e0 !important;
    background-color: #1e1e1e !important;
}

body.dark-mode .table-striped tbody tr:nth-of-type(odd),
body.dark-mode .table-striped tbody tr:nth-of-type(odd) td,
body.dark-mode .dataTable tbody tr.odd,
body.dark-mode .dataTable tbody tr.odd td {
    background-color: #2b2b2b !important;
}

body.dark-mode .table-striped tbody tr:nth-of-type(even),
body.dark-mode .table-striped tbody tr:nth-of-type(even) td,
body.dark-mode .dataTable tbody tr.even,
body.dark-mode .dataTable tbody tr.even td {
    background-color: #1e1e1e !important;
}

body.dark-mode .table-hover tbody tr:hover,
body.dark-mode .table-hover tbody tr:hover td,
body.dark-mode .dataTable tbody tr:hover,
body.dark-mode .dataTable tbody tr:hover td {
    background-color: #3a3a3a !important;
    color: #fff !important;
}

/* Pagination / DataTables Info Dark Mode */
body.dark-mode .dataTables_wrapper .dataTables_info,
body.dark-mode .dataTables_wrapper .dataTables_length,
body.dark-mode .dataTables_wrapper .dataTables_filter,
body.dark-mode .dataTables_wrapper .dataTables_paginate {
    color: #e0e0e0 !important;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #e0e0e0 !important;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--secondary-color) !important;
    color: white !important;
    border-color: var(--secondary-color) !important;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #333 !important;
    color: white !important;
    border-color: #444 !important;
}

/* Bootstrap Modals in Dark Mode */
body.dark-mode .modal-content {
    background-color: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-color: #2d2d2d !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .modal-header {
    border-bottom-color: #2d2d2d !important;
}

body.dark-mode .modal-header .modal-title {
    color: #ffffff !important;
}

body.dark-mode .modal-header .close,
body.dark-mode .modal-header .btn-close {
    color: #ffffff !important;
    text-shadow: none !important;
    opacity: 0.8 !important;
}

body.dark-mode .modal-header .close:hover,
body.dark-mode .modal-header .btn-close:hover {
    opacity: 1 !important;
}

body.dark-mode .modal-footer {
    border-top-color: #2d2d2d !important;
}

body.dark-mode .modal-body {
    color: #e0e0e0 !important;
}
