/* assets/css/style.css - Symmetrical Clinical Content Styling & Color Palette */
:root {
    --teal: #087d8d;
    --teal-dark: #055a66;
    --teal-light: #e6f4f6;
    --teal-border: #b2e0e6;
    --navy: #0f172a;
    --gold: #f59e0b;
    --gold-dark: #d97706;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1e293b;
    background-color: #f8fafc;
}

.text-teal { color: var(--teal) !important; }
.text-teal-dark { color: var(--teal-dark) !important; }
.bg-teal { background-color: var(--teal) !important; }
.bg-teal-light { background-color: var(--teal-light) !important; }
.border-teal-border { border-color: var(--teal-border) !important; }

.btn-teal {
    background-color: var(--teal);
    color: #ffffff;
    border: none;
}
.btn-teal:hover {
    background-color: var(--teal-dark);
    color: #ffffff;
}

.btn-outline-teal {
    color: var(--teal);
    border: 2px solid var(--teal);
    background: transparent;
}
.btn-outline-teal:hover {
    background-color: var(--teal);
    color: #ffffff;
}

/* Preloader Overlay & Auto-Dismiss Rules */
#sitePreloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}
#sitePreloader.loaded {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

.logo-pulse-ring {
    display: inline-block;
    padding: 8px;
    background: var(--teal-light);
    border: 2px solid var(--teal-border);
    border-radius: 50%;
    animation: pulseRing 2s infinite;
}
.preloader-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}
.preloader-progress-bar {
    width: 220px;
    height: 6px;
    background: var(--teal-light);
    border-radius: 10px;
    overflow: hidden;
}
.preloader-progress-fill {
    width: 0%;
    height: 100%;
    background: var(--teal);
    animation: fillProgress 1s forwards;
}
@keyframes pulseRing {
    0% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(8, 125, 141, 0.4); }
    70% { transform: scale(1.04); box-shadow: 0 0 0 15px rgba(8, 125, 141, 0); }
    100% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(8, 125, 141, 0); }
}
@keyframes fillProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Brand Navbar */
.brand-logo-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--teal-border);
}
.brand-title-main {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--navy);
    line-height: 1.2;
}
.brand-sub {
    font-size: 0.75rem;
    color: var(--teal-dark);
    font-weight: 700;
}

/* High-Resolution Full Aspect-Ratio Banner Styling (No Cropping or Quality Loss) */
#heroBootstrapCarousel {
    width: 100%;
    background: #0f172a;
}
.hero-bs-img {
    width: 100%;
    height: auto;
    max-height: 750px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Page Hero */
.page-hero {
    background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
    color: #ffffff;
    padding: 3.5rem 0;
}
.eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 800;
    text-uppercase: uppercase;
    letter-spacing: 1px;
    color: var(--teal);
    background: var(--teal-light);
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 1rem;
}
.page-title {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}
.page-desc {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 720px;
}

/* Marrow Subject Cards Grid */
.marrow-subject-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #ffffff;
    border: 1.5px solid var(--teal-border);
    border-radius: 14px;
    padding: 1.2rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.25s ease;
}
.marrow-subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(8, 125, 141, 0.12);
    border-color: var(--teal);
}
.marrow-subject-icon {
    font-size: 1.8rem;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--teal-light);
    color: var(--teal);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.marrow-subject-info h4 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 0.2rem;
}
.marrow-subject-info span {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}
.marrow-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--teal-light);
    border-radius: 4px;
    margin-top: 0.6rem;
    overflow: hidden;
}
.marrow-progress-fill {
    height: 100%;
    background: var(--teal);
}

/* Symmetrical Formatted Clinical Content Styling */
.formatted-clinical-content {
    line-height: 1.8;
    color: #1e293b;
}
.formatted-clinical-content h1,
.formatted-clinical-content h2,
.formatted-clinical-content h3,
.formatted-clinical-content h4 {
    color: var(--teal);
    font-weight: 800;
    margin-top: 1.4rem;
    margin-bottom: 0.6rem;
}
.formatted-clinical-content p {
    margin-bottom: 1rem;
}
.formatted-clinical-content ul,
.formatted-clinical-content ol {
    margin-bottom: 1.2rem;
    padding-left: 1.4rem;
}
.formatted-clinical-content li {
    margin-bottom: 0.4rem;
}
.formatted-clinical-content strong,
.formatted-clinical-content b {
    color: var(--navy);
    font-weight: 700;
}
.formatted-clinical-content table {
    width: 100%;
    margin-bottom: 1.2rem;
    border-collapse: collapse;
}
.formatted-clinical-content table th,
.formatted-clinical-content table td {
    padding: 10px 14px;
    border: 1px solid var(--teal-border);
}
.formatted-clinical-content table th {
    background-color: var(--teal-light);
    color: var(--teal);
    font-weight: 700;
}

/* Floating Actions */
.floating-whatsapp {
    position: fixed;
    bottom: 18px;
    right: 25px;
    width: 54px;
    height: 54px;
    background: #25d366;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1030;
    text-decoration: none;
    transition: transform 0.2s ease;
}
.floating-whatsapp:hover {
    transform: scale(1.1);
    color: #ffffff;
}
.floating-call, .floating-chat {
    position: fixed; right: 25px; width: 48px; height: 48px; border: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.35rem;
    box-shadow: 0 4px 15px rgba(15,23,42,.22); z-index: 1030; text-decoration: none; cursor: pointer;
    transition: transform .2s ease;
}
.floating-call:hover, .floating-chat:hover { transform: translateY(-2px); color:#fff; }
.floating-call { bottom: 78px; background: var(--teal); }
.floating-chat { bottom: 138px; background: var(--navy); }
.help-chat-panel { position:fixed; z-index:1040; right:20px; bottom:198px; width:min(360px,calc(100vw - 32px)); height:min(460px,calc(100dvh - 250px)); min-height:280px; background:#fff; border:1px solid var(--teal-border); border-radius:18px; box-shadow:0 16px 48px rgba(15,23,42,.2); overflow:hidden; display:flex; flex-direction:column; }
.help-chat-panel[hidden] { display:none; }
.help-chat-head { display:flex; justify-content:space-between; align-items:center; padding:14px 16px; color:#fff; background:var(--teal-dark); }
.help-chat-head button { color:#fff; border:0; background:transparent; font-size:1.5rem; line-height:1; }
.help-chat-messages { flex:1; overflow:auto; padding:14px; display:flex; flex-direction:column; gap:10px; }
.help-chat-reply,.help-chat-user { max-width:88%; padding:10px 12px; border-radius:14px; line-height:1.45; white-space:pre-wrap; overflow-wrap:anywhere; }
.help-chat-reply { background:var(--teal-light); color:var(--navy); align-self:flex-start; }
.help-chat-user { background:#0f172a; color:#fff; align-self:flex-end; }
.help-chat-form { display:flex; gap:8px; padding:12px; border-top:1px solid #e2e8f0; }
.help-chat-form input { min-width:0; flex:1; border:1px solid #cbd5e1; border-radius:10px; padding:9px 11px; }
.content-toggle-btn { display:block; width:100%; padding:8px 16px; border:0; border-bottom:1px solid var(--teal-border); color:var(--teal-dark); background:#f7fcfd; text-align:right; font-weight:700; }
.content-toggle-btn:hover { background:var(--teal-light); }
.content-fullscreen-btn { display:block; width:100%; padding:7px 16px; border:0; border-bottom:1px solid var(--teal-border); color:var(--teal); background:#fff; text-align:right; font-weight:700; }
.content-fullscreen-btn:hover { background:var(--teal-light); }
.content-focus-mode { position:fixed!important; inset:0!important; z-index:1055!important; overflow-y:auto!important; width:100%!important; max-height:100dvh!important; margin:0!important; border-radius:0!important; background:#fff!important; }
:fullscreen { overflow-y:auto!important; max-height:100dvh; border-radius:0!important; background:#fff!important; }
:fullscreen .card-body { overflow:visible; }
.scroll-top-btn {
    position: fixed;
    bottom: 90px;
    left: 25px;
    right: auto;
    width: 42px;
    height: 42px;
    background: var(--teal);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(8, 125, 141, 0.3);
    z-index: 999;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
}

/* Site Footer */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding-top: 4rem;
    padding-bottom: 2rem;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}
.footer-col h4 {
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}
.footer-col a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    margin-bottom: 0.6rem;
    font-weight: 500;
    transition: color 0.2s ease;
}
.footer-col a:hover {
    color: var(--teal-border);
}
.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.2rem;
}

/* Admin navigation: clear active state, keyboard focus and mobile drawer. */
.admin-sidebar-toggle { flex: 0 0 auto; min-width: 44px; min-height: 44px; }
.admin-header { z-index: 1050; gap: .75rem; }
.admin-header-actions { margin-left: auto; }
.admin-sidebar { height: calc(100vh - 56px); position: sticky; top: 56px; overflow-y: auto; transition: width .2s ease, transform .2s ease, padding .2s ease; z-index: 1040; }
.admin-sidebar-inner { padding: 1.25rem .9rem; }
.admin-sidebar-mobile-head { align-items: center; justify-content: space-between; padding: .25rem .5rem 1rem; color: var(--navy); }
.admin-nav-caption { color: #526574; font-size: .7rem; font-weight: 800; letter-spacing: .08em; margin: .3rem .75rem .55rem; text-transform: uppercase; }
.admin-nav-link { align-items: center; border-radius: .75rem; color: #244354; display: flex; font-size: .9rem; font-weight: 700; gap: .75rem; line-height: 1.35; min-height: 44px; padding: .65rem .75rem; }
.admin-nav-link i { color: var(--teal-dark); flex: 0 0 1.2rem; font-size: 1.05rem; text-align: center; }
.admin-nav-link:hover { background: #e9f5f6; color: #064f5a; }
.admin-nav-link.active, .admin-nav-link[aria-current="page"] { background: #dceff1; box-shadow: inset 3px 0 0 var(--teal); color: #064f5a; }
.admin-nav-link.active i { color: #064f5a; }
.admin-main-content { min-width: 0; transition: width .2s ease, margin .2s ease; }
body.admin-sidebar-mobile-open { overflow: hidden; }
@media (min-width: 768px) {
    body.admin-sidebar-collapsed .admin-sidebar { display: none !important; }
    body.admin-sidebar-collapsed .admin-main-content { width: 100%; margin-left: 0 !important; }
}
@media (max-width: 767.98px) {
    .admin-sidebar { height: calc(100dvh - 56px); position: fixed; top: 56px; left: 0; bottom: 0; width: min(86vw, 340px); overflow-y: auto; transform: translateX(-105%); }
    .admin-sidebar-inner { padding: 1rem .75rem calc(2rem + env(safe-area-inset-bottom)); }
    .admin-sidebar-mobile-head { display: flex; }
    body.admin-sidebar-mobile-open .admin-sidebar { transform: translateX(0); }
    body.admin-sidebar-mobile-open::after { content: ''; position: fixed; inset: 56px 0 0; background: rgba(15, 23, 42, .35); z-index: 1035; }
    .admin-main-content { width: 100%; margin-left: 0 !important; }
    .admin-header { flex-wrap: nowrap; padding-left: .75rem !important; padding-right: .75rem !important; }
    .admin-brand-name { font-size: .82rem; }
}
@media (max-width: 575.98px) {
    .admin-header { gap: .35rem; }
    .admin-header .navbar-brand { gap: .4rem !important; margin-right: .25rem; }
    .admin-header .navbar-brand img { height: 32px; width: 32px; }
    .admin-brand-name { font-size: .7rem; line-height: 1.2; }
    .admin-header-actions { gap: .35rem !important; }
    .admin-header-actions .btn { min-height: 40px; padding-left: .6rem !important; padding-right: .6rem !important; }
    .admin-action-label { display: none; }
}
@media (max-width: 575.98px) {
    .page-hero { padding:2rem 0; }
    .page-title { font-size:1.8rem; }
    .page-desc { font-size:1rem; }
    .shell { padding-left: .85rem; padding-right: .85rem; }
    .footer-grid { grid-template-columns:1fr; gap:1.5rem; }
    .floating-whatsapp,.floating-call,.floating-chat { right:8px; width:40px; height:40px; font-size:1.15rem; }
    .floating-whatsapp { bottom:calc(12px + env(safe-area-inset-bottom)); }
    .floating-call { bottom:calc(60px + env(safe-area-inset-bottom)); }
    .floating-chat { bottom:calc(108px + env(safe-area-inset-bottom)); }
    .help-chat-panel { right:8px; bottom:calc(158px + env(safe-area-inset-bottom)); width:calc(100vw - 16px); height:min(55dvh,460px); }
    .content-toggle-btn,.content-fullscreen-btn { text-align:left; }
    .scroll-top-btn { left:14px; right:auto; bottom:calc(14px + env(safe-area-inset-bottom)); }
    body:has(#osceExamWrapper) #scrollTopBtn,
    body:has(#mcqExamWrapper) #scrollTopBtn { display:none; }
    .osce-bottom-nav,.mcq-bottom-nav { padding-right:56px; }
    .osce-bottom-nav #oscleNextBtn,.mcq-bottom-nav #mcqNextBtn { margin-right:56px; }
}

/* Consistent keyboard visibility and motion preference support. */
:focus-visible { outline: 3px solid #db9b2b !important; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
