/* Base scaling */
html {
    font-size: 14px;
}
@media (min-width: 768px) {
    html { font-size: 16px; }
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    padding: 0;
    background-color: #000;            /* Pure black background */
    color: #e6e6e6;                     /* Light text */
    font-family: "Segoe UI", Arial, sans-serif;
}

/* ===========================================
   STICKY HORIZONTAL SCROLLBAR FOR TABLES
   Scrollbar remains visible at bottom of viewport
   =========================================== */

/* Table container */
.table-responsive {
    position: relative;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Style the regular table scrollbar */
.table-responsive::-webkit-scrollbar {
    height: 14px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 7px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #555 0%, #444 100%);
    border-radius: 7px;
    border: 2px solid #1a1a1a;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #666 0%, #555 100%);
}

/* Sticky scrollbar - ALWAYS VISIBLE DESIGN */
.sticky-scrollbar-wrapper {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 30px !important;
    background: linear-gradient(to top, #000 0%, #111 100%) !important;
    border-top: 3px solid #258cfb !important;
    z-index: 999999 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    display: none !important;
    box-shadow: 0 -4px 20px rgba(37, 140, 251, 0.3) !important;
}

.sticky-scrollbar-wrapper.active {
    display: block !important;
}

.sticky-scrollbar-content {
    height: 1px !important;
    background: transparent !important;
}

/* HIGHLY VISIBLE scrollbar styling */
.sticky-scrollbar-wrapper::-webkit-scrollbar {
    height: 26px !important;
}
.sticky-scrollbar-wrapper::-webkit-scrollbar-track {
    background: #000 !important;
    border-radius: 0 !important;
}
.sticky-scrollbar-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #5aaeff 0%, #258cfb 50%, #0d6efd 100%) !important;
    border-radius: 13px !important;
    border: 4px solid #000 !important;
    min-width: 80px !important;
}
.sticky-scrollbar-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #85c1e9 0%, #5aaeff 50%, #3498db 100%) !important;
    box-shadow: 0 0 10px rgba(37, 140, 251, 0.5) !important;
}
.sticky-scrollbar-wrapper::-webkit-scrollbar-thumb:active {
    background: linear-gradient(to bottom, #a8d5ff 0%, #85c1e9 50%, #5aaeff 100%) !important;
}

/* Firefox scrollbar */
.sticky-scrollbar-wrapper {
    scrollbar-width: auto !important;
    scrollbar-color: #258cfb #000 !important;
}

/* Sticky footer: use flex layout; no extra bottom padding */
body { padding-bottom: 0 !important; }
/* Headings use blue accent */
h1, h2, h3, h4, h5, h6 {
    color: #258cfb;
    font-weight: 600;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Links */
a {
    color: #258cfb;
    text-decoration: none;
}
a:hover, a:focus {
    color: #5aaeff;
    text-decoration: underline;
}

/* Layout helpers */
.container, .container-fluid {
    padding-top: 1rem;
}

/* Cards / panels */
.card, .jumbotron, .bordered-block {
    background-color: #111;
    border: 1px solid #2a2a2a;
    color: #e6e6e6;
    border-radius: 4px;
}
.card-header, .card-footer {
    background-color: #141414;
    border-bottom: 1px solid #2a2a2a;
    color: #d0d0d0;
}

/* Forms */
.form-control, .form-select {
    background-color: #121212;
    border: 1px solid #2f2f2f;
    color: #f2f2f2;
}
.form-control:focus, .form-select:focus {
    background-color: #181818;
    border-color: #258cfb;
    color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(37,140,251,0.35);
}

/* Ensure select and disabled select controls remain high-contrast in dark theme */
.form-select,
.form-select:disabled,
select[disabled],
.form-control:disabled {
    background-color: #121212 !important;
    border-color: #2f2f2f !important;
    color: #f2f2f2 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #f2f2f2 !important; /* Safari */
}

/* Options inside selects (some browsers honor these) */
.form-select option,
select option {
    background-color: #121212;
    color: #f2f2f2;
}

/* If the browser adds a readonly/disabled appearance, force a clear contrast */
.form-select[disabled]::-ms-value,
.form-select[disabled]::-moz-focus-inner {
    color: #f2f2f2 !important;
}

/* Labels */
label {
    color: #dcdcdc;
    font-weight: 500;
}

/* Checkboxes & radios */
.form-check-input {
    appearance: auto !important;
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;

    width: 1.1rem;
    height: 1.1rem;

    background-color: #ffffff !important;    /* white box */
    border: 1px solid #cfd3da !important;
    accent-color: #258cfb;                   /* blue tick / radio fill */
}
.form-check-input[type="radio"] { border-radius: 50%; }
.form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 0.15rem rgba(255,255,255,0.25),
                0 0 0 0.3rem rgba(37,140,251,0.40);
    border-color: #258cfb !important;
}
.form-check-label { color: #e6e6e6; }

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 4px;
    transition: background-color .15s, border-color .15s, box-shadow .15s;
}

/* Primary (often general action) */
.btn-primary {
    background-color: #258cfb;
    border-color: #258cfb;
    color: #ffffff;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #ffffff;
}

/* Success (Save) */
.btn-success {
    background-color: #198754;
    border-color: #198754;
    color: #ffffff;
}
.btn-success:hover, .btn-success:focus {
    background-color: #157347;
    border-color: #157347;
}

/* Secondary (Edit) */
.btn-secondary {
    background-color: #444;
    border-color: #555;
    color: #e6e6e6;
}
.btn-secondary:hover, .btn-secondary:focus {
    background-color: #555;
    border-color: #666;
    color: #ffffff;
}

/* Danger (Delete) */
.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}
.btn-danger:hover, .btn-danger:focus {
    background-color: #bb2d3b;
    border-color: #bb2d3b;
}

/* Outline variants keep dark background */
.btn-outline-primary {
    color: #258cfb;
    border-color: #258cfb;
    background: transparent;
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: #258cfb;
    color: #fff;
}

/* Focus ring */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus {
    box-shadow: 0 0 0 0.15rem rgba(255,255,255,0.25), 0 0 0 0.3rem rgba(37,140,251,0.4);
    outline: none;
}

/* Tables */
.table {
    color: #e6e6e6;
    background-color: #111;
    border-color: #2a2a2a;
}
.table > :not(caption) > * > * {
    background-color: #111;
    border-bottom: 1px solid #2a2a2a;
}
.table-striped tbody tr:nth-of-type(odd) {
    background-color: #181818;
}
.table-hover tbody tr:hover {
    background-color: #202020;
}

/* Ensure table cell text remains high-contrast in all rows (override bootstrap or other rules) */
.table tbody td,
.table tbody th {
    color: #e6e6e6 !important;
}

/* Keep header text slightly brighter */
.table thead th {
    color: #ffffff;
}

/* Utility text accents */
.text-accent {
    color: #ffb86c; /* Light orange option */
}
.text-faint {
    color: #9ca3af;
}

/* Small separators */
.hr-dark {
    border: 0;
    border-top: 1px solid #2a2a2a;
    margin: 1.25rem 0;
}

/* Footer (if any) */
footer {
    background-color: #111;
    color: #9ca3af;
    border-top: 1px solid #2a2a2a;
    padding: .5rem 0;          /* was 1rem */
    position: static !important;
}

/* Scrollbar (optional for dark comfort - works in WebKit browsers) */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: #000;
}
::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #444c56;
}

/* Ensure secondary buttons have high-contrast text and icons */
.btn-secondary,
.btn-secondary * {
    color: #e6e6e6 !important;
    opacity: 1 !important;
}
.btn-secondary .bi {
    color: #e6e6e6 !important;
    opacity: 1 !important;
}

/* ===========================================
   NOTIFICATION SYSTEM STYLES
   =========================================== */

/* Notification bell button */
.notification-dropdown .btn-link {
    color: #e6e6e6 !important;
    text-decoration: none;
}

.notification-dropdown .btn-link:hover {
    color: #258cfb !important;
}

/* Notification badge */
.notification-badge {
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    line-height: 14px;
    padding: 2px 5px;
}

/* Notification dropdown menu */
.notification-menu {
    width: 360px;
    max-width: 90vw;
    padding: 0;
    background-color: #1a1a1a;
    border: 1px solid #333;
}

.notification-header {
    background-color: #222;
}

.notification-header h6 {
    color: #e6e6e6;
}

/* Notification list items */
.notification-item {
    border-bottom: 1px solid #2a2a2a;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.notification-item:hover {
    background-color: #252525 !important;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background-color: #1e2a3a;
}

.notification-item.read {
    opacity: 0.7;
}

.notification-title {
    color: #e6e6e6;
    font-size: 0.9rem;
}

.notification-message {
    color: #aaa;
    font-size: 0.8rem;
}

.notification-time {
    color: #888;
    font-size: 0.75rem;
}

.notification-icon {
    font-size: 1.2rem;
    width: 32px;
    text-align: center;
}

/* Unread dot indicator */
.unread-dot {
    width: 8px;
    height: 8px;
    background-color: #258cfb;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Footer link */
.notification-footer {
    background-color: #222;
}

.notification-footer a {
    text-decoration: none;
}

.notification-footer a:hover {
    text-decoration: underline;
}

/* Toast notifications styling */
.toast {
    background-color: #1a1a1a;
    border: 1px solid #333;
}

.toast-header {
    border-bottom: 1px solid #333;
}

/* Notification list page items */
.notification-list-item {
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.notification-list-item:hover {
    background-color: #1a1a1a !important;
    transform: translateX(2px);
}

/* Min width helper for text truncation */
.min-width-0 {
    min-width: 0;
}

/* ===========================================
   IMPROVED TEXT VISIBILITY
   Ensure text is clearly readable throughout the app
   =========================================== */

/* Override Bootstrap opacity utilities for better visibility in dark theme */
.opacity-50 {
    opacity: 0.7 !important; /* Increase from 0.5 to 0.7 for better readability */
}

.opacity-75 {
    opacity: 0.85 !important; /* Increase from 0.75 to 0.85 */
}

/* Ensure text-muted has sufficient contrast in dark theme */
.text-muted {
    color: #b0b0b0 !important; /* Lighter gray for better visibility */
}

/* Card text should be clearly visible */
.card-text, .card-body p {
    color: #d0d0d0;
}

/* Improve badge text contrast */
.badge {
    font-weight: 500;
}

.badge.bg-light {
    color: #212529 !important;
}

/* Ensure small text remains readable */
small, .small, .form-text {
    color: #a0a0a0;
}

/* Better contrast for table headers with colored backgrounds */
.table-light, .bg-light {
    background-color: #2a2a2a !important;
    color: #e6e6e6 !important;
}

.table-light th, .table-light td {
    color: #e6e6e6 !important;
}

/* Improve icon visibility */
.bi {
    color: inherit;
}

/* Warning cards text visibility */
.bg-warning, .btn-warning {
    color: #212529 !important;
}

.bg-warning .small, .bg-warning small {
    color: #212529 !important;
    opacity: 0.9;
}

/* Info cards with white text */
.bg-info {
    color: #ffffff !important;
}

.bg-info .small, .bg-info small, .bg-info .opacity-75 {
    color: rgba(255, 255, 255, 0.9) !important;
    opacity: 1 !important;
}

/* Primary and Success cards */
.bg-primary .small, .bg-primary small, .bg-primary .opacity-75,
.bg-success .small, .bg-success small, .bg-success .opacity-75 {
    color: rgba(255, 255, 255, 0.9) !important;
    opacity: 1 !important;
}

/* Entry count badge styling */
.entry-count-badge {
    color: white !important;
}

.entry-count-badge .opacity-75 {
    opacity: 0.9 !important;
}

/* Alert improvements */
.alert {
    color: inherit;
}

.alert-info {
    background-color: #1a3a5c;
    border-color: #258cfb;
    color: #c5dcf5;
}

.alert-success {
    background-color: #1a3a2a;
    border-color: #198754;
    color: #b8e6c8;
}

.alert-warning {
    background-color: #3a3a1a;
    border-color: #ffc107;
    color: #f5e6a5;
}

.alert-danger {
    background-color: #3a1a1a;
    border-color: #dc3545;
    color: #f5b8b8;
}

/* Light background cards need dark text override for Academic Setup page */
.academic-setup-container .setup-card .card-body p {
    color: #495057 !important;
}

.academic-setup-container h2, .academic-setup-container .text-muted {
    color: #495057 !important;
}

.academic-setup-container h2 i.text-primary {
    color: #0d6efd !important;
}



