/* ============================================================
 * Mobile-only stylesheet — Flipkart/Amazon-style polish.
 * Strictly additive: nothing here applies above 992px, so the
 * desktop layout is completely unaffected.
 *
 * Load AFTER style.css so these rules win specificity ties.
 * ============================================================ */

/* ------------------------------------------------------------
 * 1. GLOBAL — mobile only
 * ------------------------------------------------------------ */
@media (max-width: 991px) {

    /* Tighter overall padding */
    body {
        padding-bottom: 70px !important; /* room for fixed bottom nav */
        -webkit-text-size-adjust: 100%;
    }

    /* Hide desktop-only header chrome on mobile */
    .mobile-hide { display: none !important; }

    /* Touch-friendly tap targets (Apple HIG = 44px minimum) */
    .btn,
    .nav-link,
    .dropdown-item,
    a.btn-sm,
    button {
        min-height: 40px;
    }

    /* Card spacing tighter on mobile so more fits on screen */
    .card { border-radius: 10px !important; }
    .card + .card { margin-top: 12px; }

    /* Stack any 2-column rows */
    .row.g-3 > [class*="col-"],
    .row.g-2 > [class*="col-"] {
        margin-bottom: 8px;
    }
}

/* ------------------------------------------------------------
 * 2. TOP HEADER — slim down on mobile
 * ------------------------------------------------------------ */
@media (max-width: 991px) {

    /* The big "Access to Academic Journals" announcement strip */
    .academic-header,
    .header-strip {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }

    /* Quick-link About/Contact buttons — hide on mobile (in hamburger anyway) */
    .quick-link-btn { display: none !important; }

    /* Brand title sizing */
    .brand-title { font-size: 18px !important; }
    .brand-sub   { font-size: 11px !important; letter-spacing: 1px; }

    /* Search bar full width below logo */
    .header-search,
    .search-form-wrapper {
        margin-top: 10px !important;
        width: 100% !important;
    }

    /* Country selector / user button area — stack */
    .header-user-area {
        margin-top: 8px;
        text-align: left !important;
    }
}

/* ------------------------------------------------------------
 * 3. NAVBAR — make Bootstrap collapse look like a slide-in drawer
 * ------------------------------------------------------------ */
@media (max-width: 991px) {

    .navbar-dark { padding: 6px 10px !important; }

    .navbar-toggler {
        border: 1px solid rgba(255,255,255,0.3) !important;
        padding: 6px 10px;
    }

    .navbar-collapse {
        background: #1f2937;
        margin: 0 -10px;
        padding: 8px 16px;
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }

    .navbar-nav .nav-link {
        padding: 12px 4px !important;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        font-size: 14px;
    }
    .navbar-nav .nav-item:last-child .nav-link { border-bottom: 0; }

    /* Dropdown shows inline (Bootstrap collapsed behaviour) */
    .navbar-nav .dropdown-menu {
        background: transparent !important;
        border: 0 !important;
        padding-left: 16px;
    }
    .navbar-nav .dropdown-menu .dropdown-item {
        color: #cfd8e3 !important;
        padding: 10px 6px !important;
        font-size: 13px;
    }
    .navbar-nav .dropdown-menu .dropdown-item:hover {
        background: rgba(255,255,255,0.06) !important;
    }
}

/* ------------------------------------------------------------
 * 4. PAGE CONTENT — common mobile fixes
 * ------------------------------------------------------------ */
@media (max-width: 991px) {

    .container,
    .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    h1, .h1 { font-size: 22px !important; }
    h2, .h2 { font-size: 19px !important; }
    h3, .h3 { font-size: 17px !important; }
    h4, .h4 { font-size: 16px !important; }
    h5, .h5 { font-size: 15px !important; }

    .display-4, .display-5, .display-6 { font-size: 24px !important; }

    /* Tables → horizontal scroll instead of breaking layout */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    table { font-size: 13px; }

    /* Form fields readable */
    .form-control, .form-select { font-size: 15px !important; }
    .form-control-lg { font-size: 16px !important; }

    /* Big primary buttons go full-width on mobile */
    .btn-lg,
    .btn-block,
    .btn-primary.w-100,
    .btn-success.w-100 {
        width: 100% !important;
    }
}

/* ------------------------------------------------------------
 * 5. JOURNAL / ARTICLE CARDS — stack cleanly
 * ------------------------------------------------------------ */
@media (max-width: 767px) {

    /* Force single column for journal listing cards */
    .journal-card,
    .article-card,
    .pricing-card,
    .package-card {
        margin-bottom: 14px;
    }

    /* Card headers tighter */
    .card-header { padding: 10px 14px !important; }
    .card-body   { padding: 14px !important; }

    /* Badges spacing */
    .badge { margin-bottom: 4px; }

    /* Footer of cards — wrap meta */
    .card-footer .row > div { margin-bottom: 6px; }
}

/* ------------------------------------------------------------
 * 6. FILTER SIDEBAR — convert to bottom-sheet on mobile
 * ------------------------------------------------------------ */
@media (max-width: 991px) {

    /* Hide the inline filter card by default; show via toggle */
    .filter-sidebar:not(.show) {
        display: none !important;
    }

    /* Show the floating "Filter" button */
    .mobile-filter-fab {
        display: flex !important;
        position: fixed;
        bottom: 78px;          /* above bottom nav */
        right: 14px;
        width: 56px; height: 56px;
        border-radius: 50%;
        background: #0066CC;
        color: #fff !important;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 12px rgba(0,0,0,0.25);
        z-index: 1040;
        font-size: 22px;
        text-decoration: none;
    }

    /* When toggled open, render filter as a sheet */
    .filter-sidebar.show {
        position: fixed !important;
        left: 0; right: 0; bottom: 0;
        max-height: 78vh;
        overflow-y: auto;
        background: #fff;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 18px rgba(0,0,0,0.18);
        padding: 18px;
        z-index: 1050;
        animation: slideUp 0.25s ease-out;
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    /* Backdrop when sheet open */
    .filter-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.45);
        z-index: 1045;
    }
}

/* Desktop: hide the FAB always */
.mobile-filter-fab { display: none; }

/* ------------------------------------------------------------
 * 7. BOTTOM NAV BAR — Amazon/Flipkart style
 * ------------------------------------------------------------ */
.mobile-bottom-nav {
    display: none;          /* shown only on mobile via media query */
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    z-index: 1030;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.mobile-bottom-nav .nav-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px 6px;
    text-decoration: none;
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
    border-right: 1px solid #f3f4f6;
    transition: color 0.15s;
}
.mobile-bottom-nav a:last-child { border-right: 0; }

.mobile-bottom-nav a i {
    font-size: 18px;
    margin-bottom: 3px;
}

.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
    color: #0066CC;
}

.mobile-bottom-nav a.active {
    border-top: 2px solid #0066CC;
    margin-top: -1px;
}

@media (max-width: 991px) {
    .mobile-bottom-nav { display: block; }
}

/* ------------------------------------------------------------
 * 8. FOOTER — slim down on mobile
 * ------------------------------------------------------------ */
@media (max-width: 767px) {

    footer .row > [class*="col-"] {
        margin-bottom: 18px;
    }

    footer h5, footer h6 { font-size: 15px !important; }
    footer p, footer a   { font-size: 13px !important; }
    footer { padding-bottom: 80px !important; } /* extra room above bottom nav */
}
