/* ================================================================
   LINQIN.IN — RESPONSIVE.CSS  v2 (clean, conflict-free)
   
   RULE: Only override at specific breakpoints.
         Never override base rules globally.
   
   Desktop (≥1024px): Dashboard uses position:fixed sidebar + 
                       margin-left on page-wrap. Defined in 
                       dashboard.css. We don't touch it here.
   
   Tablet (768–1023px): Sidebar slides off-screen left.
   Mobile (<768px):     Same + extra layout fixes.
   ================================================================ */

/* ── 0. SAFE GLOBAL RESETS ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html  { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
body  { overflow-x: hidden; }
img   { max-width: 100%; height: auto; }

/* Fix CSS variable syntax errors (extra closing bracket in app.css) */
:root {
  --grad-brand:  linear-gradient(135deg, #f97316 0%, #ea6500 100%);
  --grad-orange: linear-gradient(135deg, #f97316, #fb923c);
  --grad-navy:   linear-gradient(135deg, #0f1d4a, #2a4299);
}

/* ── 1. HOMEPAGE NAV HAMBURGER ──────────────────────────────── */
.mob-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
.mob-burger span {
  display: block; width: 18px; height: 2px;
  background: #151A42; border-radius: 2px; transition: all .25s;
}
.mob-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mob-burger.open span:nth-child(2) { opacity: 0; }
.mob-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav drawer */
.mob-nav-drawer {
  display: none;
  position: fixed;
  inset: 60px 0 0 0;
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 199;
  padding: 1.25rem 1rem;
  flex-direction: column;
  gap: .2rem;
  border-top: 1px solid #e2e8f0;
  overflow-y: auto;
}
.mob-nav-drawer.open { display: flex; }
.mob-nav-drawer a {
  display: flex; align-items: center;
  padding: .8rem 1rem; border-radius: 10px;
  font-size: .95rem; font-weight: 500; color: #374151;
  border-bottom: 1px solid #f1f5f9; transition: background .15s;
}
.mob-nav-drawer a:hover { background: #f8f9ff; color: #151A42; }
.mob-nav-drawer .mob-btn-login {
  margin-top: .5rem; border: 1.5px solid #e2e8f0;
  color: #151A42; font-weight: 700; justify-content: center;
}
.mob-nav-drawer .mob-btn-cta {
  background: #F99110; color: #fff !important; font-weight: 700;
  justify-content: center; border-radius: 10px; margin-top: .25rem;
  box-shadow: 0 4px 14px rgba(249,145,16,.35);
}

/* ── 2. DASHBOARD SIDEBAR TOGGLE BUTTON (base, hidden on desktop) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 700;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: #151A42;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  box-shadow: 0 2px 16px rgba(0,0,0,.35);
}
.sidebar-toggle span {
  display: block; width: 100%; height: 2px;
  background: #fff; border-radius: 2px; transition: all .22s;
}
.sidebar-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.sidebar-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Overlay (hidden by default) */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 699;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ── 3. MODALS ──────────────────────────────────────────────── */
.modal-overlay { padding: .75rem; }
@media (min-width: 640px) { .modal-overlay { align-items: center; } }

/* ── 4. RESPONSIVE TABLES ───────────────────────────────────── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-responsive table { min-width: 500px; }

/* ══════════════════════════════════════════════════════════════
   TABLET (768px – 1023px) + MOBILE (<768px)
   Sidebar slides off-screen. Hamburger visible.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {

  /* ── Sidebar: slide off-screen left ── */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -260px !important;
    bottom: 0 !important;
    width: 240px !important;
    height: 100vh !important;
    z-index: 700 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: none !important;
    transition: left .25s cubic-bezier(.4,0,.2,1) !important;
    /* IMPORTANT: keep display:flex so sidebar is visible when open */
    display: flex !important;
    flex-direction: column !important;
  }
  .sidebar.open {
    left: 0 !important;
    box-shadow: 6px 0 40px rgba(0,0,0,.35) !important;
  }

  /* ── Show hamburger ── */
  .sidebar-toggle { display: flex !important; }

  /* ── Page content — full width, padded top for hamburger ── */
  .page-wrap {
    margin-left: 0 !important;
    padding-top: 68px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-bottom: 32px !important;
  }

  /* ── Stats grid 2 col ── */
  .stats-grid { grid-template-columns: 1fr 1fr !important; }

  /* ── Page header ── */
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px;
  }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE ONLY (<768px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* Homepage nav */
  .mob-burger  { display: flex !important; }
  .nav-links   { display: none !important; }
  .nav-i       { padding: 0 14px !important; height: 60px !important; }
  .nav         { height: 60px !important; }

  /* Containers */
  .container, .container-sm, .csm {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  /* ── Hero ── */
  .hero         { padding: 2rem 0 1.5rem !important; min-height: auto !important; }
  .hero-grid    { grid-template-columns: 1fr !important; gap: 0 !important; }
  .phone-wrap   { display: none !important; }
  .fbadge       { display: none !important; }
  .h1           { font-size: clamp(1.75rem, 8vw, 2.2rem) !important; }
  .hero-sub     { max-width: 100% !important; font-size: .9rem !important; }
  .hbtns        { flex-direction: column !important; gap: 10px !important; }
  .hbp, .hbs   { width: 100% !important; text-align: center !important; justify-content: center !important; padding: 13px 16px !important; }
  .htrust       { gap: 8px !important; flex-wrap: wrap; }
  .payment-badges { flex-wrap: wrap !important; gap: 6px !important; }

  /* Stats */
  .stats-i      { gap: 16px 20px !important; padding: 0 14px !important; justify-content: center; }
  .bstats       { gap: 14px 20px !important; }

  /* Sections */
  .fgrid, .steps, .plans,
  .blog-grid, .compare-grid,
  .testimonial-grid { grid-template-columns: 1fr !important; }

  /* Dashboard */
  .page-wrap    { padding-top: 60px !important; padding-left: 14px !important; padding-right: 14px !important; padding-bottom: 20px !important; }
  .page-header h1 { font-size: 1.15rem !important; }
  .stats-grid   { grid-template-columns: 1fr 1fr !important; }
  .card         { padding: 14px !important; }

  /* Tables */
  .table-wrap, .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -14px;
    padding: 0 14px;
  }
  table         { min-width: 480px; font-size: .8rem; }
  table th, table td { padding: 8px 10px !important; white-space: nowrap; }

  /* Modals — bottom sheet */
  .modal-overlay { padding: 0 !important; align-items: flex-end !important; }
  .modal         { border-radius: 20px 20px 0 0 !important; max-width: 100% !important; max-height: 90vh !important; }

  /* Forms */
  .form-group   { margin-bottom: 14px !important; }
  .form-input, .form-control, select { font-size: 16px !important; }

  /* Login / Signup */
  .image-panel  { display: none !important; }
  .form-panel   { width: 100% !important; min-width: unset !important; padding: 24px 16px !important; }

  /* Grids */
  .grid-2, .grid-3  { grid-template-columns: 1fr !important; }
  .form-grid-2      { grid-template-columns: 1fr !important; }
  .upgrade-wrap     { grid-template-columns: 1fr !important; }
  .plans-grid       { grid-template-columns: 1fr !important; }

  /* Misc */
  .link-item    { flex-wrap: wrap; gap: .5rem !important; }
  .link-meta    { width: 100%; justify-content: flex-end; }
  .profile-cover { height: 130px !important; }
  .pricing-card.popular { transform: none !important; }
  .dm-popup     { width: calc(100vw - 1.5rem) !important; right: .75rem !important; left: .75rem !important; bottom: .75rem !important; }
  #_toast       { bottom: 16px !important; right: 16px !important; left: 16px !important; max-width: calc(100vw - 32px) !important; }

  /* Touch targets */
  .btn, .hbp, .hbs, .pbtn { min-height: 44px; }
  .btn-sm  { min-height: 36px; }
  .btn-icon { min-width: 40px !important; min-height: 40px !important; }

  /* Creator cards */
  .ccard     { width: 155px !important; }
  .ccard-img { height: 220px !important; }
}

/* ══════════════════════════════════════════════════════════════
   TINY PHONES (<375px)
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 374px) {
  .h1        { font-size: 1.5rem !important; }
  .form-panel { padding: 20px 12px !important; }
  .stats-grid { grid-template-columns: 1fr !important; }
  .page-wrap  { padding-left: 10px !important; padding-right: 10px !important; }
  .nav-i      { padding: 0 10px !important; }
}

/* ══════════════════════════════════════════════════════════════
   SIGNUP / LOGIN — image panel hides on narrow
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .image-panel { display: none !important; }
  .login-wrap, .signup-wrap { flex-direction: column; height: auto !important; min-height: 100vh; }
  .form-panel  { width: 100% !important; min-width: unset !important; height: auto !important; min-height: 100vh; padding: 32px 24px !important; }
}


/* ── iOS input zoom prevention ──────────────────────────────
   font-size < 16px on inputs causes iOS Safari to zoom.
   Always set 16px on mobile inputs. */
@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px !important;
  }
}
