/* ============================================================
   TalentBridge - Global Mobile Responsive CSS
   Include this in every page:
   <link rel="stylesheet" href="/mobile.css">
   ============================================================ */

/* ── BASE MOBILE RESETS ─────────────────────────────────── */
* { -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

input, select, textarea, button {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
}

/* ── MOBILE NAV ─────────────────────────────────────────── */
@media (max-width: 768px) {

    /* Hide desktop nav links, show hamburger */
    .nav-links, .nav-links-desktop {
        display: none !important;
    }

    .nav {
        padding: 0 1rem !important;
        height: 56px !important;
        position: sticky !important;
        top: 0;
        z-index: 1000;
    }

    /* Mobile hamburger button */
    .nav-hamburger {
        display: flex !important;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        padding: 8px;
        background: none;
        border: none;
    }

    .nav-hamburger span {
        display: block;
        width: 22px;
        height: 2px;
        background: #1a1f2e;
        border-radius: 2px;
        transition: all .2s;
    }

    /* Mobile drawer menu */
    .mobile-menu {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        z-index: 999;
        padding: 1.5rem;
        overflow-y: auto;
        flex-direction: column;
        gap: 4px;
        border-top: 1px solid rgba(0,0,0,.09);
    }

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

    .mobile-menu a {
        display: flex;
        align-items: center;
        padding: 14px 16px;
        border-radius: 10px;
        font-size: 15px;
        color: #1a1f2e;
        text-decoration: none;
        font-weight: 500;
        border: 1px solid rgba(0,0,0,.06);
        margin-bottom: 4px;
    }

    .mobile-menu a:hover {
        background: #f5f7fc;
    }

    .mobile-menu a.recruiter {
        color: #7c3aed;
        border-color: rgba(124,58,237,.2);
        background: #f5f3ff;
    }

    .mobile-menu-divider {
        height: 1px;
        background: rgba(0,0,0,.06);
        margin: 8px 0;
    }

    .mobile-menu-cta {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 8px;
    }

    .mobile-menu-cta a {
        text-align: center;
        justify-content: center;
        border: none !important;
    }

    .mobile-menu-cta .btn-signin {
        background: #f5f7fc !important;
        color: #1a1f2e !important;
    }

    .mobile-menu-cta .btn-register {
        background: #1a6ef5 !important;
        color: #fff !important;
    }

    /* ── JOBS PAGE ── */
    .jobs-layout {
        flex-direction: column !important;
    }

    .jobs-sidebar {
        width: 100% !important;
        position: static !important;
    }

    .jobs-filters-toggle {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: #fff;
        border: 1px solid rgba(0,0,0,.09);
        border-radius: 10px;
        margin-bottom: 1rem;
        cursor: pointer;
        font-size: 14px;
        font-weight: 500;
    }

    .jobs-filters-panel {
        display: none;
        background: #fff;
        border: 1px solid rgba(0,0,0,.09);
        border-radius: 10px;
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .jobs-filters-panel.open {
        display: block;
    }

    /* ── HERO SEARCH ── */
    .hero {
        padding: 2rem 1rem 1.5rem !important;
    }

    .sbar {
        flex-direction: column !important;
        border-radius: 10px !important;
        gap: 0 !important;
        overflow: hidden;
    }

    .sbar .sf {
        padding: 12px !important;
        border-bottom: 1px solid rgba(0,0,0,.09);
    }

    .sbar .sdiv {
        display: none !important;
    }

    .sbar .sbtn {
        border-radius: 0 !important;
        padding: 14px !important;
        font-size: 15px !important;
    }

    .hero-stats {
        gap: 1rem !important;
        justify-content: space-around !important;
    }

    .hs .n { font-size: 16px !important; }
    .hs .l { font-size: 10px !important; }

    /* ── JOB CARDS ── */
    .jgrid {
        grid-template-columns: 1fr !important;
    }

    .jcard {
        padding: 1rem !important;
    }

    /* ── JOB DETAIL PAGE ── */
    .dbody {
        flex-direction: column !important;
        padding: 1rem !important;
    }

    .dside {
        width: 100% !important;
        order: -1; /* Show salary card ABOVE description on mobile */
    }

    .acard {
        position: static !important;
    }

    .meta-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ── REGISTER / LOGIN ── */
    .wrap {
        padding: 1rem !important;
    }

    .card {
        padding: 1.25rem !important;
    }

    .g2 {
        grid-template-columns: 1fr !important;
    }

    .g3 {
        grid-template-columns: 1fr !important;
    }

    /* ── DASHBOARDS ── */
    .dsnav, .rsnav, .aside {
        display: none !important; /* Hide sidebar on mobile */
    }

    .dca, .rdca, .main-wrap {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Mobile dashboard top nav */
    .dash-mobile-nav {
        display: flex !important;
        overflow-x: auto;
        gap: 6px;
        padding: 10px 1rem;
        background: #fff;
        border-bottom: 1px solid rgba(0,0,0,.09);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .dash-mobile-nav::-webkit-scrollbar { display: none; }

    .dash-mobile-nav a {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 7px 14px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 500;
        white-space: nowrap;
        text-decoration: none;
        color: #6b7280;
        background: #f5f7fc;
        border: 1px solid rgba(0,0,0,.06);
        flex-shrink: 0;
    }

    .dash-mobile-nav a.active {
        background: #1a6ef5;
        color: #fff;
        border-color: #1a6ef5;
    }

    .sgrid, .rsgrid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* ── TABLES → CARDS on mobile ── */
    .tbl, .jtbl, .rtbl {
        display: block !important;
    }

    .tbl thead, .jtbl thead, .rtbl thead {
        display: none !important;
    }

    .tbl tbody, .jtbl tbody, .rtbl tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        padding: 1rem !important;
    }

    .tbl tr, .jtbl tr, .rtbl tr {
        display: flex !important;
        flex-direction: column !important;
        background: #fff !important;
        border: 1px solid rgba(0,0,0,.09) !important;
        border-radius: 10px !important;
        padding: 12px !important;
        gap: 6px !important;
    }

    .tbl td, .jtbl td, .rtbl td {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 4px 0 !important;
        border-bottom: none !important;
        font-size: 13px !important;
    }

    .tbl td:first-child, .jtbl td:first-child, .rtbl td:first-child {
        font-weight: 500 !important;
        font-size: 14px !important;
        justify-content: flex-start !important;
    }

    /* ── COMPANY PROFILE ── */
    .co-body {
        flex-direction: column !important;
        padding: 1rem !important;
    }

    .co-side {
        width: 100% !important;
    }

    .co-header {
        flex-wrap: wrap !important;
    }

    .co-logo {
        width: 60px !important;
        height: 60px !important;
        font-size: 18px !important;
    }

    .co-name {
        font-size: 1.4rem !important;
    }

    .co-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── PRICING PAGE ── */
    .rec-plans, .plans-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── ADMIN ── */
    .chart-row {
        grid-template-columns: 1fr !important;
    }

    .content {
        padding: 1rem !important;
    }

    .topbar {
        padding: 0 1rem !important;
        height: 52px !important;
    }

    /* ── GENERAL UTILITIES ── */
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }

    .text-center-mobile { text-align: center !important; }

    h1 { font-size: 1.5rem !important; }
    h2 { font-size: 1.25rem !important; }

    /* Larger touch targets */
    .btn-p, .btn-o, button[type="submit"] {
        min-height: 44px;
        padding: 10px 18px !important;
    }

    /* Full width buttons on mobile */
    .btn-full-mobile {
        width: 100% !important;
        text-align: center !important;
    }

    /* ── FORMS ── */
    .fg input, .fg select, .fg textarea {
        padding: 12px !important;
    }

    /* ── FOOTER ── */
    footer {
        flex-direction: column !important;
        text-align: center !important;
        gap: 8px !important;
        padding: 1.5rem 1rem !important;
    }

    footer a {
        margin-left: 0 !important;
        margin: 0 6px !important;
    }
}

/* ── TABLET (768px - 1024px) ─────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {

    .nav-hamburger { display: none !important; }

    .sgrid, .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .dsnav, .aside {
        width: 180px !important;
    }

    .main-wrap {
        margin-left: 180px !important;
    }

    .co-side {
        width: 220px !important;
    }

    .rec-plans, .plans-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ── DESKTOP - Hide mobile-only elements ─────────────────── */
@media (min-width: 769px) {
    .nav-hamburger { display: none !important; }
    .mobile-menu { display: none !important; }
    .dash-mobile-nav { display: none !important; }
    .jobs-filters-toggle { display: none !important; }
    .show-mobile { display: none !important; }
}

/* ── SMOOTH TRANSITIONS ─────────────────────────────────── */
.mobile-menu,
.jobs-filters-panel {
    transition: all .2s ease;
}

/* ── SAFE AREA (iPhone notch) ───────────────────────────── */
@supports (padding: max(0px)) {
    .nav {
        padding-left: max(1rem, env(safe-area-inset-left)) !important;
        padding-right: max(1rem, env(safe-area-inset-right)) !important;
    }
}
/* ── Nav fixes ── */
.btn-o, .btn-p { white-space: nowrap !important; }

@media (max-width: 768px) {
  nav.nav > div[style] {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  nav.nav {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
  }
  nav.nav button.nav-hamburger {
    display: flex !important;
    flex-direction: column;
    gap: 5px;
    margin-left: auto;
  }
}

/* ── Footer links ── */
footer a {
  pointer-events: auto !important;
  cursor: pointer !important;
}
  /* ── Jobs page rlayout fix ── */
@media (max-width: 768px) {
  .rlayout {
    flex-direction: column !important;
    display: flex !important;
  }
  .rside {
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 0 !important;
    border-right: none !important;
  }
  .rmain {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
  }
}
}