:root {
    --navy: #0a192f;
    --teal-cyan: #172a45;
    --brand-blue: #3066be;
    --amber: #f4b942;
    --danger: #ef233c;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at top left, rgba(48, 102, 190, 0.10), transparent 22%),
        radial-gradient(circle at top right, rgba(244, 185, 66, 0.12), transparent 24%),
        linear-gradient(180deg, #f9fbff 0%, #f8fafc 100%);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}
.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--brand-blue);
    transition: width 0.3s ease;
}
.nav-link:hover {
    color: var(--brand-blue);
}
.nav-link:hover::after {
    width: 100%;
}

.tab-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid transparent;
    transition: transform 0.25s ease, color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.tab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -12px rgba(10, 25, 47, 0.6);
}

.course-card, .facility-box {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.25s ease;
}
.course-card:hover,
.facility-box:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px -12px rgba(10, 25, 47, 0.24);
}
.course-card:hover {
    border-color: var(--brand-blue);
}
.facility-box:hover {
    border-color: var(--brand-blue);
}

/* ============================================================
   INTERACTIVE LAYER — added for site-wide UX polish
   Scroll reveals, toasts, back-to-top, form feedback, lightbox,
   accordion motion, scrollbars and focus states.
   ============================================================ */

/* -- Custom, branded scrollbars ------------------------------------------ */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--brand-blue) #e2e8f0;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: #eef2f7; border-radius: 8px; }
*::-webkit-scrollbar-thumb { background: var(--brand-blue); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--navy); }

/* -- Accessible focus states ---------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
    border-radius: 4px;
}

/* -- Scroll-triggered reveal choreography ---------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    will-change: opacity, transform;
}
.reveal:hover {
    box-shadow: 0 16px 35px -18px rgba(10, 25, 47, 0.32);
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}
.reveal-stagger.in-view > * {
    animation: revealStagger 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.reveal-stagger.in-view > *:nth-child(1) { animation-delay: 0.02s; }
.reveal-stagger.in-view > *:nth-child(2) { animation-delay: 0.08s; }
.reveal-stagger.in-view > *:nth-child(3) { animation-delay: 0.14s; }
.reveal-stagger.in-view > *:nth-child(4) { animation-delay: 0.20s; }
.reveal-stagger.in-view > *:nth-child(5) { animation-delay: 0.26s; }
.reveal-stagger.in-view > *:nth-child(6) { animation-delay: 0.32s; }
@keyframes revealStagger {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -- Top scroll-progress bar ----------------------------------------------- */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--brand-blue), var(--amber));
    z-index: 60;
    transition: width 0.12s ease-out;
}

/* -- Back to top button ------------------------------------------------------ */
#back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 46px;
    height: 46px;
    border-radius: 9999px;
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -5px rgba(10, 25, 47, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.25s ease, visibility 0.3s;
    z-index: 55;
    cursor: pointer;
    border: none;
}
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
#back-to-top:hover {
    background: var(--brand-blue);
}

/* -- Toast notification stack ----------------------------------------------- */
#toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: min(340px, calc(100vw - 2rem));
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    box-shadow: 0 15px 30px -10px rgba(10, 25, 47, 0.35);
    color: #fff;
    background: var(--navy);
    border-left: 4px solid var(--brand-blue);
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.toast.leaving {
    animation: toastOut 0.3s ease forwards;
}
.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: var(--danger); }
.toast .toast-icon { margin-top: 1px; }
.toast.success .toast-icon { color: #10b981; }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--amber); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(24px); }
}

/* -- Live-updates ticker: pause on hover so it can be read ------------------ */
.animate-marquee:hover {
    animation-play-state: paused;
}

/* -- Form field validation feedback ------------------------------------------ */
.field-invalid {
    border-color: var(--danger) !important;
    background-color: #fef2f2 !important;
}
.field-valid {
    border-color: #10b981 !important;
}
.field-error-msg {
    display: none;
    color: var(--danger);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-top: 0.3rem;
}
.field-error-msg.show { display: block; }

/* -- Button press / loading feedback ----------------------------------------- */
.btn-interactive {
    position: relative;
    overflow: hidden;
    transform: translateZ(0);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.2s ease;
}
.btn-interactive:hover { filter: brightness(1.06); }
.btn-interactive:active { transform: scale(0.97); }
.btn-interactive .ripple {
    position: absolute;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.55);
    transform: scale(0);
    animation: rippleAnim 0.6s ease-out forwards;
    pointer-events: none;
}
@keyframes rippleAnim {
    to { transform: scale(2.6); opacity: 0; }
}
.btn-interactive.is-loading {
    color: transparent !important;
    pointer-events: none;
}
.btn-interactive.is-loading::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 18px; height: 18px;
    margin: -9px 0 0 -9px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    animation: btnSpin 0.7s linear infinite;
}
@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* -- Smooth accordion body (MUHS mandate) ------------------------------------ */
.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* -- Image skeleton shimmer while loading ------------------------------------- */
.img-skeleton {
    position: relative;
    background: linear-gradient(100deg, #e2e8f0 30%, #f1f5f9 50%, #e2e8f0 70%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.img-fade {
    opacity: 0;
    transition: opacity 0.5s ease;
}
.img-fade.loaded {
    opacity: 1;
}

/* -- Gallery lightbox ---------------------------------------------------------- */
[data-lightbox] {
    cursor: zoom-in;
}
#lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 47, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    padding: 2rem;
}
#lightbox-overlay.open {
    opacity: 1;
    visibility: visible;
}
#lightbox-overlay img {
    max-width: min(90vw, 900px);
    max-height: 85vh;
    border-radius: 16px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6);
    transform: scale(0.94);
    transition: transform 0.3s ease;
}
#lightbox-overlay.open img {
    transform: scale(1);
}
#lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    width: 42px;
    height: 42px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: background 0.2s ease;
}
#lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* -- Nav overflow hint (mobile horizontal scroll affordance) ------------------- */
.nav-scroll-wrap {
    position: relative;
}
.nav-scroll-wrap::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    height: 100%;
    width: 28px;
    background: linear-gradient(90deg, rgba(10,25,47,0), rgba(10,25,47,0.55));
    pointer-events: none;
}