/* =====================================================
   Admission Platform - Global Stylesheet
   ===================================================== */

/* --- Base & Typography --- */
:root {
    --primary: #4e73df;
    --primary-dark: #3a56b5;
    --success: #1cc88a;
    --info: #36b9cc;
    --warning: #f6c23e;
    --danger: #e74a3b;
    --dark: #1a1c2e;
    --light-bg: #f8f9fc;
    --card-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    --sidebar-width: 220px;
}

* { box-sizing: border-box; }

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    background-color: var(--light-bg);
    color: #5a5c69;
    min-height: 100%;
}

@media (min-width: 768px) {
    html { font-size: 15px; }
}

/* --- Navbar --- */
.navbar {
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    padding: 0.6rem 1.5rem;
    border-bottom: 1px solid #e3e6f0 !important;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary) !important;
    letter-spacing: 0.5px;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.85rem !important;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    background: #eef0fb;
    color: var(--primary) !important;
}

.nav-link.fw-bold { color: var(--primary) !important; }

/* --- Cards --- */
.card {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: var(--card-shadow) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover { transform: translateY(-2px); box-shadow: 0 0.5rem 2rem rgba(58, 59, 69, 0.15) !important; }

.card-header {
    background: #fff !important;
    border-bottom: 1px solid #e3e6f0 !important;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* Stat Cards with colored left border */
.border-left-primary  { border-left: 4px solid var(--primary) !important; }
.border-left-success  { border-left: 4px solid var(--success) !important; }
.border-left-info     { border-left: 4px solid var(--info) !important; }
.border-left-warning  { border-left: 4px solid var(--warning) !important; }
.border-left-danger   { border-left: 4px solid var(--danger) !important; }

/* --- Buttons --- */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 8px;
    padding: 0.45rem 1rem;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }

.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { filter: brightness(0.9); transform: translateY(-1px); }

.btn-danger { background: var(--danger); border-color: var(--danger); }

/* --- Tables --- */
.table {
    font-size: 0.875rem;
    border-radius: 8px;
    overflow: hidden;
}

.table thead th {
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e3e6f0;
    padding: 0.85rem 1rem;
}

.table td { padding: 0.85rem 1rem; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f0f3ff; }

/* --- Badges --- */
.badge { font-weight: 500; font-size: 0.78rem; padding: 0.35em 0.7em; border-radius: 6px; }
.bg-purple { background-color: #6f42c1 !important; color: white !important; }

/* --- Form controls --- */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #d1d3e2;
    font-size: 0.9rem;
    padding: 0.5rem 0.85rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.15);
}

.form-floating label { font-size: 0.9rem; color: #aaa; }
.form-floating > .form-control:focus::placeholder { text-align: start; }
.form-floating > .form-control::placeholder { color: var(--bs-secondary-color); text-align: end; }

/* --- Page Headings --- */
.h3, h1.h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #3a3b45;
}

/* --- Accordion (ManageQuestions) --- */
.accordion-button {
    font-weight: 500;
    background: #fff;
}
.accordion-button:not(.collapsed) { background: #eef0fb; color: var(--primary); }
.accordion-button:focus { box-shadow: none; }

/* --- Test Taking (StartTest) --- */
.custom-option {
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    border-radius: 10px !important;
}
.custom-option:hover { background: #f0f3ff; border-color: var(--primary) !important; }
.custom-option.selected { background: #e8edff; border-color: var(--primary) !important; }
.custom-option.selected label { font-weight: 600; color: var(--primary); }

#timer {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--danger);
}

/* --- Alerts --- */
.alert { border-radius: 10px; font-size: 0.9rem; }

/* --- Footer --- */
footer.footer {
    background: #fff;
    font-size: 0.82rem;
    padding: 1rem 0;
    color: #aaa;
    border-top: 1px solid #e3e6f0 !important;
    position: static !important;
    width: 100%;
}

/* --- Home Landing Page --- */
.card-body .btn-lg { font-size: 1rem; padding: 0.65rem 1.5rem; }
.rounded-pill { border-radius: 50rem !important; }

/* --- Opacity helper for icons --- */
.opacity-25 { opacity: 0.25; }

/* --- Dashboard stat mini cards --- */
.text-xs { font-size: 0.7rem; }
.text-gray-800 { color: #3a3b45 !important; }
.font-weight-bold { font-weight: 700 !important; }

/* --- RTL Support --- */
.rtl-content {
    direction: rtl;
    text-align: right;
}

/* --- DataTables Custom Styles --- */
.dataTables_wrapper .dataTables_length, 
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1.5rem;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 8px;
    border: 1px solid #d1d3e2;
    padding: 0.4rem 0.75rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 8px;
    border: 1px solid #d1d3e2;
    padding: 0.25rem 0.5rem;
}

.table.datatable thead th {
    position: relative;
    cursor: pointer;
    padding-right: 1.5rem;
}

.table.datatable thead .sorting:after,
.table.datatable thead .sorting_asc:after,
.table.datatable thead .sorting_desc:after {
    position: absolute;
    right: 0.5rem;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.7rem;
    opacity: 0.2;
}

.table.datatable thead .sorting:after { content: "\f0dc"; }
.table.datatable thead .sorting_asc:after { content: "\f0de"; opacity: 1; color: var(--primary); }
.table.datatable thead .sorting_desc:after { content: "\f0dd"; opacity: 1; color: var(--primary); }

.dataTables_wrapper .dataTables_info {
    font-size: 0.82rem;
    color: #858796;
    margin-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate {
    margin-top: 1rem;
}

.dataTables_wrapper .pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

.dataTables_wrapper .pagination .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
    font-size: 0.82rem;
    color: #858796;
}
.rtl-content .form-check {
    padding-right: 2.5em;
    padding-left: 0;
}
.rtl-content .form-check-input {
    float: right !important;
    margin-right: -2em !important;
    margin-left: 0 !important;
}
.rtl-content .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}
.rtl-content .me-3 {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}
.rtl-content .me-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}
.rtl-content .ms-3 {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}
.rtl-content .accordion-button::after {
    margin-right: auto;
    margin-left: 0;
}
.rtl-content .text-truncate {
    text-align: right;
}