/* =============================================
   Responsive Styles - Website
   ============================================= */

/* ---------- Header / Navbar ---------- */
.nav-container {
    flex-wrap: wrap;
    padding: 15px 20px;
}

/* Hamburger button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background-color: #08103a;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger → X animation */
.mobile-menu-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.mobile-menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ---------- Tablet (max 992px) ---------- */
@media (max-width: 992px) {
    .nav-container {
        position: relative;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-container > ul.nav {
        display: none;
        width: 100%;
        flex-direction: column;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        padding: 10px 0;
        margin-top: 10px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .nav-container > ul.nav.show {
        display: flex;
    }

    .nav-container > ul.nav > li {
        width: 100%;
    }

    .nav-container > ul.nav > li > a {
        padding: 10px 20px;
        display: block;
        border-bottom: 1px solid #f0f0f0;
    }

    /* Dropdown در موبایل - زیر آیتم مربوطه باز میشه */
    .nav-container > ul.nav > li.dropdown {
        position: relative;
    }

    .nav-container > ul.nav .dropdown-menu {
        position: static !important;
        display: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid #e0e0e0;
        border-radius: 0;
        padding: 0;
        background: #f0f4f8;
        min-width: 100%;
        width: 100%;
        float: none;
        transform: none !important;
        inset: auto !important;
    }

    .nav-container > ul.nav .dropdown-menu.mobile-open {
        display: block;
    }

    .nav-container > ul.nav .dropdown-menu .custom-dropdown-title {
        padding: 8px 20px;
        font-size: 13px;
        background: #08103a;
        color: #fff;
    }

    .nav-container > ul.nav .dropdown-menu li a.dropdown-item {
        padding: 10px 30px;
        border-bottom: 1px solid #e0e0e0;
        color: #333;
    }

    .nav-container > ul.nav .dropdown-menu li a.dropdown-item:hover {
        background: #e2eaf5;
    }

    .custom-dropdown {
        min-width: 100%;
    }
}

/* ---------- Mobile (max 576px) ---------- */
@media (max-width: 576px) {
    .nav-container {
        padding: 10px 15px;
    }

    .nav-container img {
        height: 55px !important;
    }

    /* Hero section */
    .bg-rotation {
        height: 260px !important;
        background-position: center !important;
    }

    .bg-rotation h1.display-5 {
        font-size: 1.4rem;
    }

    .bg-rotation .fs-5 {
        font-size: 0.95rem !important;
    }

    /* Cards grid */
    .row-cols-lg-4 > * {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Journal cards */
    .journal-card {
        min-height: 220px;
    }

    /* Section padding */
    section.container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Footer */
    .footer-cols > div {
        margin-bottom: 20px;
    }
}

/* ---------- Medium screens (577px - 768px) ---------- */
@media (min-width: 577px) and (max-width: 768px) {
    .row-cols-lg-4 > * {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .journal-card {
        min-height: 260px;
    }
}

/* ---------- Laboratory Tabs Mobile ---------- */
@media (max-width: 576px) {
    .laboratory-tabs .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .laboratory-tabs .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .laboratory-tabs .nav-tabs .nav-item {
        flex-shrink: 0;
    }

    .laboratory-tabs .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
    }
}
