/* ============================================
   RIS PORTAL — DARK MEDICAL NAVBAR
   Consistent with dark glassmorphic design system
   ============================================ */

/* ── Navbar base ─────────────────────────────────────────────── */
.navbar-ris {
    background: rgba(8, 15, 31, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0;
    transition: background .3s, box-shadow .3s;
}

.navbar-ris.scrolled {
    background: rgba(8, 15, 31, 0.97);
    box-shadow: 0 4px 24px rgba(0, 0, 0, .45);
}

.navbar-ris .container {
    max-width: 1400px;
    padding: 0 24px;
}

/* ── Brand ───────────────────────────────────────────────────── */
.navbar-brand-ris {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 14px 0;
    transition: opacity .2s;
}
.navbar-brand-ris:hover { opacity: .85; }

.navbar-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0078d4 0%, #00b4d8 100%);
    box-shadow: 0 4px 14px rgba(0, 180, 216, .35);
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    transition: box-shadow .25s;
}
.navbar-brand-ris:hover .navbar-brand-icon {
    box-shadow: 0 6px 20px rgba(0, 180, 216, .5);
}

.navbar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.navbar-brand-text > span:first-child {
    font-size: 18px;
    font-weight: 800;
    color: #e2e8f0;
    letter-spacing: -.3px;
    font-family: 'Inter', sans-serif;
}
[dir="rtl"] .navbar-brand-text > span:first-child,
[lang="ar"] .navbar-brand-text > span:first-child {
    font-family: 'Cairo', sans-serif;
}
.navbar-brand-subtitle {
    font-size: 10px;
    color: #64748b;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* ── Nav list ────────────────────────────────────────────────── */
.navbar-nav-ris {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-item-ris { position: relative; }

/* ── Nav links ───────────────────────────────────────────────── */
.nav-link-ris {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    color: #94a3b8;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    border-radius: 9px;
    text-decoration: none;
    transition: color .2s, background .2s;
    position: relative;
    letter-spacing: -.1px;
}
[dir="rtl"] .nav-link-ris, [lang="ar"] .nav-link-ris {
    font-family: 'Cairo', sans-serif;
}
.nav-link-ris i {
    font-size: 14px;
    width: 18px;
    text-align: center;
    transition: transform .2s;
}
.nav-link-ris:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, .05);
}
.nav-link-ris:hover i { transform: scale(1.1); }
.nav-link-ris.active { color: #00b4d8; }

/* Dropdown caret */
.nav-link-ris.dropdown-toggle::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    border: none;
    margin-left: 4px;
    font-size: 9px;
    transition: transform .25s;
    vertical-align: middle;
    color: #64748b;
}
.nav-link-ris.dropdown-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }

/* ── Dropdown menus ──────────────────────────────────────────── */
.dropdown-menu-ris {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    background: #0d1a2e;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .55);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s, transform .22s, visibility .22s;
    z-index: 1000;
    list-style: none;
    margin: 0;
    display: block;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
/* Arrow */
.dropdown-menu-ris::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 11px;
    height: 11px;
    background: #0d1a2e;
    border-left: 1px solid rgba(255, 255, 255, .09);
    border-top: 1px solid rgba(255, 255, 255, .09);
}

.dropdown-menu-ris.show,
.dropdown-menu-ris[data-bs-popper] {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu-ris.dropdown-menu-end {
    left: auto;
    right: 0;
    transform: translateX(0);
}
.dropdown-menu-ris.dropdown-menu-end::before {
    left: auto;
    right: 18px;
    transform: translateX(0) rotate(45deg);
}
.dropdown-menu-ris.dropdown-menu-end.show,
.dropdown-menu-ris.dropdown-menu-end[data-bs-popper] {
    transform: translateX(0) translateY(0);
}

/* ── Dropdown items ──────────────────────────────────────────── */
.dropdown-item-ris {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: #94a3b8;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    border-radius: 9px;
    text-decoration: none;
    transition: background .15s, color .15s;
    position: relative;
    margin: 1px 0;
}
[dir="rtl"] .dropdown-item-ris, [lang="ar"] .dropdown-item-ris {
    font-family: 'Cairo', sans-serif;
}
.dropdown-item-ris i {
    font-size: 13px;
    width: 16px;
    text-align: center;
    color: #64748b;
    transition: color .15s;
    flex-shrink: 0;
}
.dropdown-item-ris:hover {
    background: rgba(0, 180, 216, .08);
    color: #e2e8f0;
}
.dropdown-item-ris:hover i { color: #00b4d8; }
.dropdown-item-ris.active {
    background: rgba(0, 180, 216, .12);
    color: #00b4d8;
}
.dropdown-item-ris.active i { color: #00b4d8; }
.dropdown-item-ris.text-danger { color: #f87171; }
.dropdown-item-ris.text-danger:hover {
    background: rgba(239, 68, 68, .08);
    color: #fca5a5;
}
.dropdown-item-ris.disabled,
.dropdown-item-ris.opacity-50 { opacity: .4; pointer-events: none; }

/* Divider */
.dropdown-divider-ris {
    height: 1px;
    background: rgba(255, 255, 255, .06);
    margin: 5px 0;
    border: none;
}

/* Section label inside dropdown */
.dropdown-item-text {
    padding: 5px 12px 3px;
    color: #64748b;
    font-size: .72rem;
}

/* ── User menu ───────────────────────────────────────────────── */
.user-menu-ris {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 12px 5px 6px;
    color: #e2e8f0;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    border-radius: 11px;
    text-decoration: none;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .09);
    transition: background .2s, border-color .2s;
}
.user-menu-ris:hover {
    background: rgba(0, 180, 216, .08);
    border-color: rgba(0, 180, 216, .22);
    color: #e2e8f0;
}
.user-avatar-ris {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #0078d4 0%, #00b4d8 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 180, 216, .3);
}
.user-menu-ris .fa-chevron-down {
    font-size: 10px;
    color: #64748b;
    transition: transform .25s;
}
.user-menu-ris[aria-expanded="true"] .fa-chevron-down { transform: rotate(180deg); }

/* ── Navbar login/register buttons ──────────────────────────── */
.btn-ris {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13.5px;
    padding: 8px 18px;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.btn-ris-primary {
    background: linear-gradient(135deg, #0078d4 0%, #00b4d8 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 180, 216, .3);
}
.btn-ris-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 180, 216, .45);
    transform: translateY(-1px);
    color: #fff;
}
.btn-ris-outline {
    background: rgba(255, 255, 255, .05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, .14);
}
.btn-ris-outline:hover {
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 255, 255, .22);
    transform: translateY(-1px);
    color: #e2e8f0;
}

/* ── Language toggle (global — reused from _Layout <style>) ─── */
.nav-lang-toggle {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 9px;
    padding: 3px;
}
.nav-lang-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: .82rem;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s, color .15s;
    line-height: 1.3;
}
.nav-lang-btn.active {
    background: rgba(0, 180, 216, .18);
    color: #00b4d8;
}
.nav-lang-btn:hover:not(.active) {
    background: rgba(255, 255, 255, .07);
    color: #94a3b8;
}

/* ── Mobile toggler ──────────────────────────────────────────── */
.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 9px;
    padding: 7px 11px;
    background: rgba(255, 255, 255, .04);
    transition: background .2s, border-color .2s;
}
.navbar-toggler:hover {
    background: rgba(0, 180, 216, .08);
    border-color: rgba(0, 180, 216, .25);
}
.navbar-toggler:focus {
    box-shadow: 0 0 0 3px rgba(0, 180, 216, .2);
    outline: none;
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28148,163,184,0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    width: 22px;
    height: 22px;
}

/* ── Admin dropdown scrollable ───────────────────────────────── */
#adminDropdown + .dropdown-menu-ris {
    max-height: 72vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 180, 216, .3) rgba(255, 255, 255, .03);
}
#adminDropdown + .dropdown-menu-ris::-webkit-scrollbar { width: 5px; }
#adminDropdown + .dropdown-menu-ris::-webkit-scrollbar-track { background: rgba(255, 255, 255, .03); border-radius: 10px; }
#adminDropdown + .dropdown-menu-ris::-webkit-scrollbar-thumb { background: rgba(0, 180, 216, .28); border-radius: 10px; }
#adminDropdown + .dropdown-menu-ris::-webkit-scrollbar-thumb:hover { background: rgba(0, 180, 216, .5); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 991px) {
    .navbar-ris .collapse.navbar-collapse {
        background: rgba(8, 15, 31, .97);
        border-top: 1px solid rgba(255, 255, 255, .06);
        padding: 12px 0;
        margin-top: 4px;
    }
    .navbar-nav-ris { padding: 4px 0; gap: 2px; flex-direction: column; align-items: stretch; }
    .nav-link-ris { padding: 10px 16px; width: 100%; border-radius: 8px; }
    .dropdown-menu-ris {
        position: static;
        transform: none !important;
        box-shadow: none;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, .05);
        border-radius: 0;
        background: rgba(255, 255, 255, .02);
        padding: 4px 8px;
        margin-top: 4px;
        opacity: 1;
        visibility: visible;
    }
    .dropdown-menu-ris::before { display: none; }
}

/* ── Font Awesome preservation in RTL ────────────────────────── */
[dir="rtl"] .navbar-brand-ris .fa, [dir="rtl"] .navbar-brand-ris .fas,
[dir="rtl"] .navbar-brand-ris .far, [dir="rtl"] .navbar-brand-ris .fab,
[dir="rtl"] .nav-link-ris .fa, [dir="rtl"] .nav-link-ris .fas,
[dir="rtl"] .nav-link-ris .far, [dir="rtl"] .nav-link-ris .fab,
[dir="rtl"] .dropdown-item-ris .fa, [dir="rtl"] .dropdown-item-ris .fas,
[dir="rtl"] .dropdown-item-ris .far, [dir="rtl"] .dropdown-item-ris .fab,
[lang="ar"] .navbar-brand-ris .fa, [lang="ar"] .navbar-brand-ris .fas,
[lang="ar"] .navbar-brand-ris .far, [lang="ar"] .navbar-brand-ris .fab,
[lang="ar"] .nav-link-ris .fa, [lang="ar"] .nav-link-ris .fas,
[lang="ar"] .nav-link-ris .far, [lang="ar"] .nav-link-ris .fab,
[lang="ar"] .dropdown-item-ris .fa, [lang="ar"] .dropdown-item-ris .fas,
[lang="ar"] .dropdown-item-ris .far, [lang="ar"] .dropdown-item-ris .fab {
    font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands' !important;
}
