/* =====================================================
   UALC-P-RPVA  —  Global Design System
   University-grade UI  |  Bootstrap 5.3 + Inter
   Externalized from layouts/app.blade.php
===================================================== */

/* ── Design Tokens ─────────────────────────────────── */
:root {
    /* Brand */
    --ualc-primary:       #7b0d1e;
    --ualc-primary-dark:  #5a0815;
    --ualc-primary-rgb:   123, 13, 30;
    --ualc-accent:        #c8990a;
    --ualc-red:           #7b0d1e;
    --ualc-red-bright:    #c0392b;
    --ualc-light:         #f5f6fa;
    --ualc-border:        #e5e7eb;
    --ualc-text:          #1e2328;
    --ualc-text-mute:     #6b7280;

    /* Override Bootstrap primary → UALC red */
    --bs-primary:              #7b0d1e;
    --bs-primary-rgb:          123, 13, 30;
    --bs-link-color:           #7b0d1e;
    --bs-link-hover-color:     #a01e28;
    --bs-focus-ring-color:     rgba(123,13,30,.25);
    --bs-body-font-family:     'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --bs-body-color:           #1e2328;
    --bs-border-color:         #e5e7eb;
}

/* ── Base ───────────────────────────────────────────── */
html { scroll-behavior: smooth; }
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--ualc-light);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: .9375rem;
    line-height: 1.6;
    color: var(--ualc-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.01em;
}

/* ── Sidebar (Student — Red) ─────────────────────────── */
.sidebar {
    background: linear-gradient(180deg,#7b0d1e 0%,#a01e28 100%);
    min-height: 100vh;
}
.sidebar .nav-link,
#studentSidebar .nav-link {
    color: rgba(255,255,255,.72);
    border-radius: 8px;
    padding: .5rem .85rem;
    margin-bottom: 3px;
    font-size: .855rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: background .15s, color .15s;
}
.sidebar .nav-link:hover,
#studentSidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.12); }
.sidebar .nav-link.active,
#studentSidebar .nav-link.active {
    background: rgba(255,255,255,.95);
    color: #7b0d1e;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.sidebar .nav-link i,
#studentSidebar .nav-link i { width: 20px; flex-shrink: 0; }
.sidebar-section-label {
    font-size: .63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.32);
    padding: .6rem .85rem .2rem;
    margin-top: .2rem;
    list-style: none;
}

/* ── Sidebar (Admin — Red) ───────────────────────────── */
.admin-sidebar {
    background: linear-gradient(180deg, #7b0d1e 0%, #a01e28 100%);
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,.88);
    font-weight: 500;
    border-radius: 8px;
    padding: .5rem .85rem;
    margin-bottom: 3px;
    font-size: .855rem;
    display: flex;
    align-items: center;
    transition: background .15s, color .15s;
}
.admin-sidebar .nav-link:hover { background: rgba(0,0,0,.14); color: #fff; }
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,.95);
    color: #7b0d1e;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.admin-sidebar .nav-link i { width: 20px; flex-shrink: 0; }

/* ── Sidebar Layout Helpers ──────────────────────────── */
/* Desktop sticky nav column — shared by admin & student */
.ualc-sidebar-desktop {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--ualc-border);
    min-height: 58px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

/* ── Page Layout Wrapper ─────────────────────────────── */
.ualc-page-wrapper { min-height: 100vh; }

/* ── Cards ───────────────────────────────────────────── */
.card {
    border: none;
    box-shadow: 0 1px 8px rgba(0,0,0,.07);
    border-radius: 14px;
}
.card-header {
    border-bottom: 1px solid rgba(0,0,0,.06);
    padding: .75rem 1.25rem;
    background: #fff;
}
.stat-card { transition: transform .15s, box-shadow .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }

/* ── Tables ──────────────────────────────────────────── */
.table thead th {
    font-size: .73rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #7b0d1e;
    padding-top: .75rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid rgba(123,13,30,.12);
    white-space: nowrap;
}
.table tbody td {
    font-size: .875rem;
    vertical-align: middle;
    border-color: rgba(123,13,30,.07);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * {
    background-color: rgba(123,13,30,.04);
    --bs-table-accent-bg: transparent;
}

/* ── Notification Bell ───────────────────────────────── */
.notif-btn {
    position: relative;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--ualc-light);
    border: 1px solid var(--ualc-border);
    color: var(--ualc-text-mute);
    font-size: 1rem;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    flex-shrink: 0;
}
.notif-btn:hover { background: #e9ecef; color: var(--ualc-text); border-color: #d1d5db; }
.notif-dot {
    position: absolute;
    top: 4px; right: 4px;
    width: 8px; height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: notif-pulse 2s ease-in-out infinite;
}
@keyframes notif-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,.5); }
    50%       { box-shadow: 0 0 0 5px rgba(231,76,60,0); }
}

/* ── Notification Panel ──────────────────────────────── */
.ualc-notif-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 310px;
    max-width: 92vw;
    background: #fff;
    border: 1px solid rgba(123,13,30,.13);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.13);
    z-index: 2000;
    overflow: hidden;
}

/* ── Glassmorphism Banner Icon ───────────────────────── */
.banner-icon {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255,255,255,.18) !important;
    border: 1px solid rgba(255,255,255,.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}

/* ── Bento Stat Card ─────────────────────────────────── */
.bento-card {
    border-radius: 16px;
    border: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.04);
    transition: transform .18s, box-shadow .18s;
    overflow: hidden;
}
.bento-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.06);
}

/* ── Stat Counter Animation ──────────────────────────── */
.stat-num { display: inline-block; }

/* ── Active Filter Chips ─────────────────────────────── */
.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: .22rem .6rem;
    background: rgba(123,13,30,.08);
    color: #7b0d1e;
    border-radius: 20px;
    font-size: .74rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid rgba(123,13,30,.18);
    transition: background .15s;
    white-space: nowrap;
    line-height: 1.5;
}
.filter-chip:hover { background: rgba(123,13,30,.15); color: #7b0d1e; }

/* ── Badges ──────────────────────────────────────────── */
.badge {
    font-weight: 600;
    letter-spacing: .02em;
    padding: .32em .6em;
    border-radius: 6px;
}
.badge.rounded-pill { border-radius: 20px; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-sm { border-radius: 6px; font-size: .8rem; }

.btn-primary {
    background-color: var(--ualc-primary);
    border-color: var(--ualc-primary);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--ualc-primary-dark);
    border-color: var(--ualc-primary-dark);
    color: #fff;
}
.btn-outline-primary { color: var(--ualc-primary); border-color: var(--ualc-primary); }
.btn-outline-primary:hover {
    background-color: var(--ualc-primary);
    border-color: var(--ualc-primary);
    color: #fff;
}

/* ── Form controls ───────────────────────────────────── */
.form-control, .form-select {
    border-radius: 8px;
    font-size: .875rem;
    border-color: #d1d5db;
    padding: .5rem .75rem;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--ualc-primary);
    box-shadow: 0 0 0 3px rgba(var(--ualc-primary-rgb), .14);
}
.form-label {
    font-size: .845rem;
    font-weight: 600;
    color: var(--ualc-text);
    margin-bottom: .35rem;
}
.input-group .form-control:focus { z-index: 1; }

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

/* ── Pagination → UALC red ───────────────────────────── */
.pagination .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
    color: #7b0d1e;
    border: 1px solid rgba(123,13,30,.2);
    font-size: .8rem;
    padding: .3rem .65rem;
}
.pagination .page-link:hover {
    background: rgba(123,13,30,.08);
    color: #7b0d1e;
    border-color: rgba(123,13,30,.3);
}
.pagination .page-item.active .page-link {
    background: #7b0d1e;
    border-color: #7b0d1e;
    color: #fff;
}
.pagination .page-item.disabled .page-link { color: #adb5bd; }

/* ── Card footer (pagination wrapper) ───────────────── */
.card-footer {
    background: rgba(123,13,30,.025);
    border-top: 1px solid rgba(123,13,30,.07);
    border-radius: 0 0 14px 14px;
    padding: .65rem 1.25rem;
}

/* ── Avatar circles ──────────────────────────────────── */
.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    line-height: 1;
}

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ── Shared Toast Animations ─────────────────────────── */
@keyframes ualcToastIn {
    from { opacity: 0; transform: translateY(-22px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes ualcToastOut {
    to { opacity: 0; transform: translateY(-12px); }
}

/* ── Flash Toasts ────────────────────────────────────── */
.ualc-toast-wrap {
    position: fixed;
    top: 16px;
    right: 16px;
    left: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    align-items: flex-end;
}
.ualc-toast {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 28px rgba(0,0,0,.13);
    display: flex;
    width: 100%;
    max-width: 380px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.07);
    animation: ualcToastIn .38s cubic-bezier(.21,1.02,.73,1) both;
    pointer-events: all;
}
.ualc-toast.hiding {
    animation: ualcToastOut .35s ease forwards;
}
@media (max-width: 480px) {
    .ualc-toast-wrap {
        top: 12px;
        right: 12px;
        left: 12px;
        align-items: stretch;
    }
    .ualc-toast {
        max-width: 100%;
    }
}

/* ── Logout Confirmation Overlay ─────────────────────── */
.logout-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,.45);
    align-items: center;
    justify-content: center;
}
.logout-overlay-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    padding: 32px 28px;
    max-width: 360px;
    width: 90%;
    animation: ualcToastIn .22s ease both;
    text-align: center;
}
.logout-overlay-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fff0f2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.logout-overlay-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.logout-btn-proceed {
    min-width: 110px;
    border-radius: 8px;
    font-size: .84rem;
    background: #7b0d1e;
    color: #fff;
    border: none;
}

/* ── Hamburger button ────────────────────────────────── */
.hamburger-btn { color: #7b0d1e; transition: background .2s, color .2s; }
.hamburger-btn:hover,
.hamburger-btn:focus { background: rgba(123,13,30,.1); color: #7b0d1e; }
.hamburger-btn:active { background: rgba(123,13,30,.2); color: #7b0d1e; }

/* ── Print ───────────────────────────────────────────── */
@media print {
    .sidebar, .topbar, #bottom-nav, #va-toggle, #va-popup,
    .offcanvas, .btn-close { display: none !important; }
    body { background: #fff !important; font-size: 12pt; color: #000; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; border-radius: 4px !important; }
    a { color: #000; text-decoration: none; }
}
