
.navbar-medical {
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.15);
    padding: 0.75rem 0;
    min-height: 80px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
}

.navbar-medical > .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 15px;
    flex-wrap: nowrap;
}

/* ===== LOGO ===== */
.navbar-brand.medical-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex: 0 0 auto;
}

.glass-logo-container {
    width: 180px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 12px 25px;
    border: 1.5px solid rgba(255, 215, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.glass-logo-container:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

.glass-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ===== LANGUAGE SELECTOR ===== */
.language-selector {
    flex: 0 0 auto;
}

.glass-language-btn {
    background: linear-gradient(135deg,
        rgba(212, 175, 55, 0.12),
        rgba(184, 134, 11, 0.08)) !important;
    backdrop-filter: blur(20px) !important;
    border: 1.5px solid rgba(212, 175, 55, 0.3) !important;
    border-radius: 12px !important;
    padding: 0.6rem 1.2rem !important;
    color: #FFD700 !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.6rem !important;
    height: 44px !important;
    white-space: nowrap;
    min-width: 100px;
}

.glass-language-btn:hover {
    background: linear-gradient(135deg,
        rgba(212, 175, 55, 0.18),
        rgba(184, 134, 11, 0.12)) !important;
    border-color: rgba(255, 215, 0, 0.5) !important;
    transform: translateY(-2px);
}

.glass-language-btn .fa-globe {
    color: #FFD700 !important;
    font-size: 1.1rem !important;
}

/* ===== TOGGLER ===== */
.navbar-toggler.medical-toggler {
    border: none;
    background: rgba(255, 255, 255, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.navbar-toggler.medical-toggler:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.navbar-toggler.medical-toggler:active {
    transform: scale(0.95);
}

.toggler-line {
    width: 22px;
    height: 2.5px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.navbar-toggler.medical-toggler[aria-expanded="true"] .toggler-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.navbar-toggler.medical-toggler[aria-expanded="true"] .toggler-line:nth-child(2) {
    opacity: 0;
}

.navbar-toggler.medical-toggler[aria-expanded="true"] .toggler-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== NAVBAR COLLAPSE ===== */
.navbar-collapse {
    flex-grow: 1;
    justify-content: space-between;
}

/* ===== NAV LINKS ===== */
.navbar-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
}

.navbar-nav.mx-lg-auto {
    flex: 0 0 auto;
}

.nav-item {
    margin: 0 5px;
    flex-shrink: 0;
}

.nav-link.medical-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.7rem 1rem !important;
    border-radius: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    white-space: nowrap;
    height: 44px;
}

.nav-link.medical-link:hover {
    color: white !important;
    background: rgba(255, 215, 0, 0.1);
    transform: translateY(-1px);
}

.nav-link.medical-link.active {
    color: #FFD700 !important;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.nav-link.medical-link i {
    font-size: 1rem;
}

/* متن کاربر در دسکتاپ */
.nav-user-text {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 120px;
}

/* ===== CTA BUTTON ===== */
.nav-btn.medical-cta {
    background: linear-gradient(135deg, #D4AF37, #B8860B);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    font-size: 0.95rem;
    height: 44px;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-btn.medical-cta:hover {
    background: linear-gradient(135deg, #FFD700, #D4AF37);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

/* ===== DROPDOWN ===== */
.dropdown-menu.medical-dropdown {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    min-width: 200px;
}

.medical-dropdown .dropdown-item {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.7rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.medical-dropdown .dropdown-item:hover {
    background: rgba(212, 175, 55, 0.15);
    color: #FFD700;
}

/* ===== NOTIFICATIONS ===== */
.notification-badge {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -5px;
    border: 2px solid #0f172a;
}

/* ===== FIX FOR LOGIN BUTTON DISPLAY ===== */
/* نمایش دکمه ورود در همه حالت‌ها */
.navbar-nav.ms-lg-2 .nav-link.medical-link[href*="login"],
.navbar-nav.ms-lg-2 .nav-btn.medical-cta[href*="register"] {
    display: inline-flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* ===== RESPONSIVE - DESKTOP ===== */
@media (min-width: 992px) {
    .navbar-medical {
        padding: 0.5rem 0;
    }

    .navbar-medical > .container-fluid {
        flex-wrap: nowrap;
    }

    .navbar-brand.medical-brand {
        margin-right: 1rem;
    }

    .language-selector {
        margin-left: auto;
        margin-right: 1rem;
    }

    .navbar-toggler.medical-toggler {
        display: none;
    }

    .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
        flex-grow: 1;
    }

    .navbar-nav.mx-lg-auto {
        margin: 0 auto;
    }

    .navbar-nav.ms-lg-2 {
        margin-left: 0;
        display: flex !important;
        align-items: center;
        gap: 10px;
    }

    .nav-item {
        margin: 0 8px;
    }

    /* نمایش دکمه‌ها در دسکتاپ */
    .nav-item.d-none.d-lg-block {
        display: flex !important;
    }
}

/* ===== RESPONSIVE - MOBILE & TABLET ===== */
@media (max-width: 991.98px) {
    /* تنظیمات container */
    .navbar-medical > .container-fluid {
        padding: 0 15px;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
    }

    /* لوگو در موبایل */
    .navbar-brand.medical-brand {
        margin-right: 0;
        flex: 0 0 auto;
    }

    .glass-logo-container {
        width: 140px;
        height: 50px;
        padding: 10px 15px;
        border-radius: 12px;
    }

    /* زبان سلکتور در موبایل */
    .language-selector {
        margin: 0;
        flex: 0 0 auto;
    }

    .glass-language-btn {
        padding: 0.5rem 0.8rem !important;
        height: 40px !important;
        min-width: 90px !important;
    }

    /* تاگلر در موبایل */
    .navbar-toggler.medical-toggler {
        flex: 0 0 auto;
    }

    /* منوی کشویی در موبایل */
    .navbar-collapse {
        position: fixed;
        top: 80px;
        left: 15px;
        right: 15px;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(30px);
        border-radius: 15px;
        padding: 20px;
        border: 1px solid rgba(255, 215, 0, 0.15);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    .navbar-nav.mx-lg-auto,
    .navbar-nav.ms-lg-2 {
        flex-direction: column;
        width: 100%;
        margin: 0;
    }

    .nav-item {
        width: 100%;
        margin: 8px 0;
    }

    .nav-item.d-none.d-lg-block {
        display: none !important;
    }

    .nav-item.d-lg-none {
        display: flex !important;
    }

    .nav-link.medical-link {
        justify-content: center;
        padding: 0.9rem 1rem !important;
        height: auto;
    }

    .nav-btn.medical-cta {
        width: 100%;
        justify-content: center;
        margin: 10px 0 0 0;
        padding: 0.9rem 1.5rem;
    }
}

/* ===== RESPONSIVE - SMALL MOBILE ===== */
@media (max-width: 576px) {
    .navbar-medical > .container-fluid {
        padding: 0 12px;
        gap: 12px;
    }

    /* لوگو در موبایل کوچک */
    .glass-logo-container {
        width: 120px;
        height: 42px;
        padding: 8px 12px;
        border-radius: 10px;
    }

    /* زبان سلکتور در موبایل کوچک */
    .glass-language-btn {
        padding: 0.4rem 0.6rem !important;
        height: 36px !important;
        min-width: 80px !important;
        font-size: 0.85rem !important;
    }

    .glass-language-btn .fa-globe {
        font-size: 1rem !important;
    }

    /* تاگلر در موبایل کوچک */
    .navbar-toggler.medical-toggler {
        width: 40px;
        height: 40px;
    }

    .toggler-line {
        width: 20px;
        height: 2px;
    }

    /* منوی کشویی */
    .navbar-collapse {
        left: 10px;
        right: 10px;
        padding: 15px;
    }

    .nav-link.medical-link {
        padding: 0.8rem 0.9rem !important;
        font-size: 0.9rem;
    }

    .nav-btn.medical-cta {
        padding: 0.8rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ===== RESPONSIVE - VERY SMALL MOBILE ===== */
@media (max-width: 400px) {
    .navbar-medical > .container-fluid {
        padding: 0 10px;
        gap: 10px;
    }

    .glass-logo-container {
        width: 110px;
        height: 40px;
        padding: 7px 10px;
    }

    /* زبان سلکتور - فقط آیکون در موبایل خیلی کوچک */
    .glass-language-btn span.language-text {
        display: none;
    }

    .glass-language-btn span.language-short {
        display: inline-block;
    }

    .glass-language-btn {
        min-width: 60px !important;
        padding: 0.4rem !important;
    }

    .navbar-toggler.medical-toggler {
        width: 38px;
        height: 38px;
    }

    .navbar-collapse {
        left: 8px;
        right: 8px;
    }
}

/* ===== UTILITIES ===== */
.d-none.d-lg-inline {
    display: none;
}

.d-lg-none {
    display: inline;
}

@media (min-width: 992px) {
    .d-none.d-lg-inline {
        display: inline;
    }

    .d-lg-none {
        display: none;
    }
}

/* ===== FIX FOR COLLAPSE ANIMATION ===== */
.collapse:not(.show) {
    display: none;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* ===== BODY PADDING FIX ===== */
body {
    padding-top: 80px;
}

/* ===== FIX FOR MOBILE LAYOUT ===== */
@media (max-width: 991.98px) {
    .navbar-brand.medical-brand {
        margin-left: 0;
        padding-left: 0;
    }

    .glass-logo-container {
        transform: none !important;
    }

    .glass-logo-container:hover {
        transform: translateY(-2px) !important;
    }

    .navbar-medical > .container-fluid {
        gap: 15px;
    }
}

/* ===== FIX FOR OVERLAPPING ===== */
@media (max-width: 991.98px) {
    .navbar-brand.medical-brand,
    .language-selector,
    .navbar-toggler.medical-toggler {
        flex: 0 0 auto;
        max-width: none;
    }

    .navbar-medical > .container-fluid {
        flex-wrap: nowrap;
        justify-content: space-between;
    }

    .navbar-brand.medical-brand {
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    .language-selector {
        flex: 0 0 auto;
        width: auto;
    }

    .navbar-toggler.medical-toggler {
        flex: 0 0 auto;
        width: 44px;
    }
}

/* ===== TABLET SPECIFIC FIXES ===== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .navbar-medical > .container-fluid {
        padding: 0 20px;
        gap: 15px;
    }

    .glass-logo-container {
        width: 150px;
        height: 50px;
    }

    .glass-language-btn {
        min-width: 85px !important;
        padding: 0.5rem 0.8rem !important;
    }

    /* نمایش نوتیفیکیشن و دکمه‌ها */
    .navbar-collapse .nav-item,
    .navbar-collapse .nav-link.medical-link,
    .navbar-collapse .nav-btn.medical-cta {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}
/* ===== ENHANCED RESPONSIVE FOR SMALL DESKTOPS ===== */

/* 1. مانیتورهای متوسط (992px تا 1200px) */
@media (min-width: 992px) and (max-width: 1200px) {
    .navbar-medical > .container-fluid {
        padding: 0 15px;
        gap: 10px;
    }

    /* لوگو کوچک‌تر */
    .glass-logo-container {
        width: 150px;
        height: 55px;
        padding: 10px 20px;
    }

    /* زبان سلکتور جمع‌وجور */
    .glass-language-btn {
        min-width: 85px !important;
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
    }

    /* آیتم‌های منو کوچک‌تر */
    .nav-item {
        margin: 0 4px !important;
    }

    .nav-link.medical-link {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.85rem !important;
        gap: 0.4rem;
        height: 40px;
    }

    .nav-link.medical-link i {
        font-size: 0.9rem !important;
    }

    /* CTA دکمه کوچک‌تر */
    .nav-btn.medical-cta {
        padding: 0.6rem 1.2rem !important;
        font-size: 0.85rem !important;
        height: 40px;
        min-width: 130px;
    }
}

/* 2. مانیتورهای کوچک (1200px تا 1400px) */
@media (min-width: 1200px) and (max-width: 1400px) {
    .navbar-medical > .container-fluid {
        padding: 0 20px;
    }

    .glass-logo-container {
        width: 170px;
        height: 58px;
    }
}

/* 3. تبلت لنداسکیپ (768px تا 992px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* ریسپانسیو پیشرفته برای تبلت */
    .navbar-medical > .container-fluid {
        padding: 0 15px;
        gap: 12px;
    }

    /* لوگو مناسب تبلت */
    .glass-logo-container {
        width: 130px;
        height: 48px;
        padding: 8px 15px;
        border-radius: 12px;
    }

    /* زبان سلکتور جمع‌وجور */
    .language-selector {
        margin-left: auto;
        margin-right: 10px;
    }

    .glass-language-btn {
        min-width: 75px !important;
        padding: 0.45rem 0.7rem !important;
        font-size: 0.8rem !important;
        height: 38px !important;
    }

    /* تاگلر کوچک‌تر */
    .navbar-toggler.medical-toggler {
        width: 40px;
        height: 40px;
    }

    .toggler-line {
        width: 20px;
        height: 2px;
    }

    /* منوی کشویی جمع‌وجور */
    .navbar-collapse {
        top: 70px;
        padding: 15px;
        border-radius: 12px;
    }

    /* منوهای اصلی در یک خط */
    .navbar-nav.mx-lg-auto {
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        margin-bottom: 15px;
    }

    .navbar-nav.mx-lg-auto .nav-item {
        width: auto;
        margin: 0;
    }

    .navbar-nav.mx-lg-auto .nav-link.medical-link {
        padding: 0.6rem 0.8rem !important;
        font-size: 0.8rem !important;
        height: 36px;
        min-width: 40px;
        justify-content: center;
    }

    /* نمایش فقط آیکون در تبلت */
    .navbar-nav.mx-lg-auto .nav-link.medical-link span:not(.notification-badge) {
        display: none;
    }

    .navbar-nav.mx-lg-auto .nav-link.medical-link i {
        margin: 0 !important;
        font-size: 0.9rem;
    }

    /* نمایش متن روی hover */
    .navbar-nav.mx-lg-auto .nav-link.medical-link:hover span:not(.notification-badge) {
        display: block;
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(15, 23, 42, 0.95);
        padding: 0.5rem 0.8rem;
        border-radius: 6px;
        white-space: nowrap;
        z-index: 1000;
        border: 1px solid rgba(255, 215, 0, 0.3);
        font-size: 0.8rem;
        margin-top: 5px;
    }

    /* بخش کاربری */
    .navbar-nav.ms-lg-2 {
        flex-direction: row !important;
        justify-content: center;
        gap: 10px;
        padding-top: 15px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar-nav.ms-lg-2 .nav-item {
        width: auto;
        margin: 0;
    }

    .nav-btn.medical-cta {
        width: auto;
        padding: 0.6rem 1rem !important;
        font-size: 0.8rem !important;
        margin: 0;
    }
}

/* 4. تبلت کوچک (768px تا 850px) */
@media (min-width: 768px) and (max-width: 850px) {
    .navbar-medical > .container-fluid {
        gap: 10px;
    }

    .glass-logo-container {
        width: 120px;
        height: 45px;
        padding: 7px 12px;
    }

    .glass-language-btn {
        min-width: 70px !important;
        padding: 0.4rem 0.6rem !important;
    }

    .navbar-nav.mx-lg-auto {
        gap: 6px;
    }

    .navbar-nav.mx-lg-auto .nav-link.medical-link {
        padding: 0.5rem 0.7rem !important;
        min-width: 36px;
    }
}

/* 5. ریسپانسیو هوشمند با clamp() */
@media (min-width: 768px) {
    /* استفاده از clamp برای سایزهای پویا */
    .glass-logo-container {
        width: clamp(120px, 15vw, 180px);
        height: clamp(45px, 6vw, 60px);
        padding: clamp(7px, 1vw, 12px) clamp(12px, 2vw, 25px);
    }

    .glass-language-btn {
        min-width: clamp(70px, 10vw, 100px) !important;
        padding: clamp(0.4rem, 0.6vw, 0.6rem) clamp(0.6rem, 1vw, 1.2rem) !important;
        font-size: clamp(0.8rem, 0.9vw, 0.95rem) !important;
    }

    .nav-link.medical-link {
        font-size: clamp(0.8rem, 0.9vw, 0.95rem) !important;
        padding: clamp(0.5rem, 0.6vw, 0.7rem) clamp(0.7rem, 1vw, 1rem) !important;
    }

    .nav-btn.medical-cta {
        font-size: clamp(0.8rem, 0.9vw, 0.95rem) !important;
        padding: clamp(0.5rem, 0.6vw, 0.7rem) clamp(1rem, 1.2vw, 1.5rem) !important;
    }
}

/* 6. فیکس برای آیتم‌های زیاد در مانیتور کوچک */
@media (min-width: 992px) and (max-width: 1200px) {
    /* مخفی کردن برخی آیتم‌ها در صورت نیاز */
    .navbar-nav.mx-lg-auto .nav-item:nth-child(n+5) {
        display: none;
    }

    /* نمایش dropdown برای آیتم‌های مخفی */
    .nav-item.more-dropdown {
        display: flex !important;
    }

    .more-dropdown .dropdown-menu {
        min-width: 180px;
    }
}

/* 7. بهبود فاصله‌ها در همه سایزها */
.navbar-medical > .container-fluid {
    gap: clamp(10px, 1.5vw, 15px);
}

.nav-item {
    margin: 0 clamp(3px, 0.5vw, 8px) !important;
}

/* 8. فیکس برای نوتیفیکیشن در مانیتور کوچک */
@media (min-width: 768px) and (max-width: 991.98px) {
    .notification-badge {
        position: relative !important;
        top: 0 !important;
        right: 0 !important;
        margin-left: 5px;
        font-size: 0.65rem !important;
        min-width: 16px !important;
        height: 16px !important;
    }

    .nav-link.medical-link.has-notification {
        position: relative;
    }
}

/* 9. تنظیمات ارتفاع نوبار */
@media (max-width: 991.98px) {
    .navbar-medical {
        min-height: 70px;
        padding: 0.5rem 0;
    }

    body {
        padding-top: 70px;
    }

    .navbar-collapse {
        top: 70px;
    }
}

/* 10. ریسپانسیو پیشرفته برای زبان سلکتور */
.glass-language-btn span.language-text {
    display: inline-block;
}

.glass-language-btn span.language-short {
    display: none;
}

@media (max-width: 850px) {
    .glass-language-btn span.language-text {
        display: none;
    }

    .glass-language-btn span.language-short {
        display: inline-block;
    }

    .glass-language-btn {
        min-width: 50px !important;
        padding: 0.4rem !important;
    }
}

/* 11. فیکس برای CTA دکمه در مانیتور کوچک */
@media (min-width: 768px) and (max-width: 991.98px) {
    .nav-btn.medical-cta {
        min-width: 120px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* 12. بهبود display در تبلت */
@media (min-width: 768px) and (max-width: 991.98px) {
    .navbar-collapse {
        display: none !important;
    }

    .navbar-collapse.show {
        display: block !important;
    }

    /* نمایش المان‌ها به صورت درست */
    .navbar-nav.mx-lg-auto,
    .navbar-nav.ms-lg-2 {
        display: flex !important;
    }
}

/* 13. انیمیشن smooth برای تغییر سایز */
.navbar-medical,
.glass-logo-container,
.glass-language-btn,
.nav-link.medical-link,
.nav-btn.medical-cta {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}