/* ATM Training Management - Application styles */

/* ── Override Bootstrap's primary colour throughout ─────────────────────────
   Bootstrap 5.3 uses CSS custom properties for bg-primary, text-primary,
   border-primary, badges, spinners, focus rings, table-primary etc.
   Setting --bs-primary-rgb here propagates to all of them automatically.   */
:root {
    --bs-primary:         #ed2024;
    --bs-primary-rgb:     237, 32, 36;
    --bs-link-color:      #ed2024;
    --bs-link-color-rgb:  237, 32, 36;
    --bs-link-hover-color:#be1a1d;
    --bs-focus-ring-color: rgba(237, 32, 36, 0.25);
}

/* btn-primary — Bootstrap 5.3 reads component-level CSS vars for every state */
.btn-primary {
    --bs-btn-color:              #fff;
    --bs-btn-bg:                 #ed2024;
    --bs-btn-border-color:       #ed2024;
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           #be1a1d;
    --bs-btn-hover-border-color: #b21719;
    --bs-btn-focus-shadow-rgb:   237, 32, 36;
    --bs-btn-active-color:       #fff;
    --bs-btn-active-bg:          #b21719;
    --bs-btn-active-border-color:#a61618;
    --bs-btn-disabled-color:     #fff;
    --bs-btn-disabled-bg:        #ed2024;
    --bs-btn-disabled-border-color: #ed2024;
}

/* btn-outline-primary */
.btn-outline-primary {
    --bs-btn-color:              #ed2024;
    --bs-btn-border-color:       #ed2024;
    --bs-btn-hover-color:        #fff;
    --bs-btn-hover-bg:           #ed2024;
    --bs-btn-hover-border-color: #ed2024;
    --bs-btn-focus-shadow-rgb:   237, 32, 36;
    --bs-btn-active-color:       #fff;
    --bs-btn-active-bg:          #ed2024;
    --bs-btn-active-border-color:#ed2024;
    --bs-btn-disabled-color:     #ed2024;
    --bs-btn-disabled-bg:        transparent;
    --bs-btn-disabled-border-color: #ed2024;
}

/* table-primary — Bootstrap hardcodes the blue tint in compiled CSS, must override */
.table-primary {
    --bs-table-color:        #000;
    --bs-table-bg:           rgba(237, 32, 36, 0.1);
    --bs-table-border-color: rgba(237, 32, 36, 0.2);
    --bs-table-striped-bg:   rgba(237, 32, 36, 0.13);
    --bs-table-active-bg:    rgba(237, 32, 36, 0.16);
    --bs-table-hover-bg:     rgba(237, 32, 36, 0.13);
}

/* form-control focus ring */
.form-control:focus,
.form-select:focus {
    border-color: rgba(237, 32, 36, 0.5);
    box-shadow: 0 0 0 0.25rem rgba(237, 32, 36, 0.25);
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top navigation bar ──────────────────────────────────────────────────── */
.navbar {
    background: linear-gradient(155deg, #b21719 0%, #d31a1e 40%, #ed2024 75%, #f04040 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.20);
    padding-top: 0;
    padding-bottom: 0;
    min-height: 56px;
}

.navbar .navbar-brand {
    padding: 0;
}

.navbar .navbar-brand span {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.92);
}

/* User chip (avatar + name) */
.nav-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-avatar {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.18);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.nav-user-name {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 500;
}

/* Vertical separator */
.nav-sep {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.25);
    margin: 0 4px;
}

/* Sign-out button */
.btn-nav-signout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.40);
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-nav-signout:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.70);
    color: #fff;
}

/* Sidebar navigation */
.nav-group-header {
    color: #ed2024;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 16px 16px 4px 16px;
}

.nav-link {
    color: #424242;
    padding: 8px 16px;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: background-color 0.15s;
}

.nav-link i {
    width: 20px;
    color: #757575;
    margin-right: 6px;
}

.nav-link:hover {
    background-color: rgba(237, 32, 36, 0.05);
    color: #ed2024;
}

.nav-link:hover i {
    color: #ed2024;
}

.nav-link.active {
    background-color: rgba(237, 32, 36, 0.09);
    color: #ed2024;
    border-left-color: #ed2024;
    font-weight: 600;
}

.nav-link.active i {
    color: #ed2024;
}

/* ── Page title bar ──────────────────────────────────────────────────────── */
.page-title-bar {
    background: #fff;
    border-bottom: 1px solid #e6e8ec;
    padding: 11px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 52px;
}

.page-title-heading {
    font-size: 15px;
    font-weight: 700;
    color: #15181d;
    margin: 0;
    padding-left: 12px;
    border-left: 3px solid #ed2024;
    line-height: 1.3;
}

/* ── Data tables ─────────────────────────────────────────────────────────── */
.data-table {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.data-table table {
    margin-bottom: 0;
    font-size: 13px;
}

.data-table thead {
    background-color: #f7f8fa;
}

.data-table thead th {
    font-weight: 600;
    font-size: 12px;
    color: #1a1a1a;
    border-bottom: 2px solid #e6e8ec;
    padding: 10px 12px;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 8px 12px;
    border-color: #f0f0f0;
    vertical-align: middle;
}

.data-table tbody tr {
    cursor: pointer;
}

.data-table tbody tr:hover {
    background-color: #fdf3f3 !important;
}

/* Filter bar */
.filter-bar {
    background: white;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* Count badge */
.count-badge {
    background-color: #ed2024;
    color: white;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Form sections */
.form-section-header {
    color: #ed2024;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 6px;
    border-bottom: 2px solid rgba(237, 32, 36, 0.15);
}

/* Status badges */
.badge-status-active     { background-color:#E8F5E9; color:#2E7D32; }
.badge-status-pending    { background-color:#FFF8E1; color:#F57C00; }
.badge-status-cancelled  { background-color:#FFEBEE; color:#C62828; }
.badge-status-completed  { background-color:#E3F2FD; color:#1565C0; }

/* Buttons */
.btn-primary {
    background-color: #ed2024;
    border-color: #ed2024;
}
.btn-primary:hover {
    background-color: #eb1518;
    border-color: #eb1518;
}

/* Quick search */
.quick-search {
    max-width: 320px;
}

/* Location type-ahead picker */
.location-dropdown {
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
}

.location-dropdown .list-group-item-action:hover {
    background-color: rgba(237, 32, 36, 0.07);
    color: #b21719;
}

/* Prevent tab-content overflow clipping the dropdown */
.tab-content {
    overflow: visible !important;
}

.tab-pane {
    overflow: visible !important;
}

/* Valid/invalid states for location picker */
.location-search.is-valid {
    border-color: #198754;
    padding-right: calc(1.5em + 0.5rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
}


/* Edit form footer */
.form-actions {
    background: white;
    border-top: 1px solid #E0E0E0;
    padding: 12px 16px;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* Sidebar version footer */
.sidebar-version {
    text-align: center;
    font-size: 11px;
    color: #bdbdbd;
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    letter-spacing: 0.03em;
}

/* Tab styling */
.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #757575;
    padding: 12px 18px;
}

.nav-tabs .nav-link.active {
    color: #ed2024;
    background: transparent;
    border-bottom-color: #ed2024;
    font-weight: 600;
}

/* ── Error toast (MessageBoxError) ────────────────────────── */
.MessageBoxError {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 3000;
    max-width: 360px;
    background: #fde8e9;
    color: #a31217;
    border: 1px solid #f5c2c7;
    border-left: 4px solid #ed2024;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 13px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* ── Modal overlay (dims page behind pop-ups) ─────────────── */
#lightsoff {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2100;
}

/* Card-style pop-up used by Programs / Calendar */
.student-detail {
    margin: 0 auto;
    overflow: auto;
    padding: 24px 28px;
    background: #fff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    z-index: 2200;
    top: 80px;
    max-width: 900px;
    width: calc(100% - 40px);
    position: fixed;
    left: 0;
    right: 0;
}

/* ── Danger Zone ──────────────────────────────────────────── */
.sd-danger-zone {
    border: 1px solid #f8d7da;
    border-radius: 8px;
    overflow: hidden;
}

.sd-danger-zone-header {
    background: #fff5f5;
    border-bottom: 1px solid #f8d7da;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #b91c1c;
}

.sd-danger-zone-body {
    padding: 12px;
    background: #fff;
}