/* ═══════════════════════════════════════════════════════════
   JAMAYAAI PORTAL — RESPONSIVE CSS  (FIXED v2)
   Add this file as: /wp-content/themes/Theme/templates/responsive.css
   Then add in header.php:
   <link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/templates/responsive.css">
   ═══════════════════════════════════════════════════════════ */

/* ── MOBILE NAV TOGGLE BUTTONS (hidden on desktop) ─────────── */

/* LEFT toggle — opens sidebar-avatar */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  background: rgba(108, 69, 235, 0.9);
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  backdrop-filter: blur(6px);
}
.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
}
.mobile-menu-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.open span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* RIGHT toggle — opens sidebar-business (Settings panel) */
.mobile-settings-btn {
  display: none;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10000;
  background: rgba(108, 69, 235, 0.9);
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.mobile-settings-btn svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  fill: none;
  flex-shrink: 0;
}

/* ── OVERLAY when any mobile sidebar is open ─────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 9000;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active {
  display: block;
}

/* ════════════════════════════════════════════════════════════
   BREAKPOINT 1: TABLET  ≤ 1200px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .h-stats .stat-box:nth-child(n + 6) {
    display: none;
  }

  .stat-box {
    min-width: 80px;
    padding: 4px 8px;
  }
  .s-num {
    font-size: 17px;
  }
  .s-lbl {
    font-size: 7.5px;
  }
  .stat-icons {
    gap: 3px;
  }
  .stat-icon svg {
    width: 13px;
    height: 13px;
  }
  .icon-count {
    font-size: 7px;
  }

  .sidebar-avatar {
    width: 160px;
  }
  .sidebar-business {
    width: 140px;
    padding: 10px;
  }
}

/* ════════════════════════════════════════════════════════════
   BREAKPOINT 2: SMALL TABLET  ≤ 992px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
  .h-stats .stat-box:nth-child(n + 4) {
    display: none;
  }
  .h-contact .lbl {
    display: none;
  }
  .logo-text {
    font-size: 16px;
  }

  /* ── Metrics: shrink to single compact row on tablet ── */
  .h-metrics {
    overflow: hidden;
  }
  .h-metrics-row {
    grid-template-columns: repeat(5, 1fr);
  }
  .metric-box {
    padding: 6px 8px;
    gap: 3px;
  }
  .m-num {
    font-size: 13px;
  }
  .m-lbl {
    font-size: 8px;
    letter-spacing: 0.05em;
  }
  .m-dot {
    width: 3px;
    height: 3px;
    margin-right: 3px;
  }

  .portal-container {
    padding: 0;
    position: relative;
  }

  /* sidebar-avatar: slides in from LEFT */
  .sidebar-avatar {
    position: fixed;
    left: -260px;
    top: 110px;
    bottom: 0;
    width: 240px;
    z-index: 9500;
    transition: left 0.3s ease;
    overflow-y: auto;
    height: calc(100vh - 110px);
  }
  .sidebar-avatar.open {
    left: 0;
  }

  /* sidebar-business: slides in from RIGHT — FIXED */
  .sidebar-business {
    position: fixed;
    right: -260px; /* off-screen to the RIGHT */
    left: auto !important;
    top: 110px;
    bottom: 0;
    width: 240px;
    z-index: 9500; /* same level as avatar sidebar */
    transition: right 0.3s ease;
    overflow-y: auto;
    height: calc(100vh - 110px);
  }
  .sidebar-business.open {
    right: 0; /* slides in from right edge */
    left: auto !important;
  }

  .main-area {
    width: 100%;
  }

  /* Show both mobile toggles */
  .mobile-menu-btn {
    display: flex;
  }
  .mobile-settings-btn {
    display: flex;
  }

  header {
    padding-left: 52px;
    padding-right: 52px;
  }
  .h-logo {
    padding-left: 8px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0;
  }
  .footer-left {
    width: 100%;
    justify-content: center;
    padding: 16px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
  }
  .footer-right {
    padding: 16px;
  }
  .fsf-grid,
  .fsf-row2,
  .fsf-row {
    flex-direction: column;
    gap: 10px;
  }
  .fsf-field.w1,
  .fsf-field.w2,
  .fsf-field.w3 {
    max-width: 100%;
  }
  .fsf-name-logo {
    flex-direction: row;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

/* ════════════════════════════════════════════════════════════
   BREAKPOINT 3: MOBILE  ≤ 768px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* ── Header becomes a vertical stack ── */
  header {
    height: auto !important;
    min-height: unset !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    padding: 0 !important;
    gap: 0 !important;
    position: relative !important;
  }

  /* glow line must be absolute so it doesn't break the flex column */
  .h-glow-line {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    pointer-events: none;
  }

  /* ── Row 1: logo + contact side by side ── */
  .h-logo,
  .h-contact {
    display: flex !important;
  }

  /* Fake a top bar row by giving logo and contact fixed height */
  .h-logo {
    order: 1;
    padding: 10px 52px 10px 56px; /* 56px left clears the hamburger btn */
    min-height: 54px;
    align-items: center;
    flex: 0 0 auto;
  }
  .h-logo .logo img {
    height: 36px;
  }
  .logo-text {
    font-size: 13px;
    letter-spacing: 0;
  }

  .h-sep {
    display: none !important;
  }

  .h-contact {
    order: 2;
    padding: 0 52px 8px 56px;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
  }
  .h-contact .lbl {
    display: none;
  }
  .h-contact .val {
    font-size: 11px;
  }

  .h-actions {
    order: 3;
    display: none; /* hidden — handled by mobile buttons */
  }

  /* ── Metrics: full-width 5×2 grid, no horizontal scroll ── */
  .h-metrics {
    order: 4;
    width: 100%;
    flex: 0 0 auto;
    overflow: hidden;
    align-self: stretch;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .h-metrics-row {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    width: 100%;
  }

  .h-metrics-row a {
    display: block;
    width: 100%;
  }

  .metric-box {
    padding: 5px 3px;
    gap: 2px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    align-items: center;
  }
  .metric-box:last-child {
    border-right: none;
  }

  .m-num {
    font-size: 11px;
    letter-spacing: 0.02em;
  }
  .m-lbl {
    font-size: 6.5px !important;
    letter-spacing: 0.03em !important;
    white-space: normal !important;
    text-overflow: unset !important;
    overflow: visible !important;
    text-align: center !important;
    line-height: 1.1 !important;
  }
  .m-dot {
    display: none; /* hide dot on mobile — too tight */
  }

  .h-stats {
    display: none !important;
  }
  .h-spacer {
    display: none !important;
  }

  /* ── TAD dialer: ensure it floats above everything on mobile ── */
  .tad-phone-widget,
  .tad-dialer,
  .tad-panel,
  #tad-widget,
  #tad-phone,
  [class*="tad-"],
  [id*="tad-"] {
    z-index: 99999 !important;
  }

  .h-avatar {
    width: 38px;
    height: 38px;
  }
  .h-icon {
    width: 28px;
    height: 28px;
  }
  .h-icon svg {
    width: 14px;
    height: 14px;
  }

  /* sidebar-avatar: full-width from LEFT */
  .sidebar-avatar {
    top: 140px;
    height: calc(100vh - 140px);
    left: -100vw;
    width: 80vw;
    max-width: 280px;
  }
  .sidebar-avatar.open {
    left: 0;
  }

  /* sidebar-business: full-width from RIGHT — FIXED */
  .sidebar-business {
    top: 140px;
    height: calc(100vh - 140px);
    right: -100vw !important;
    left: auto !important;
    width: 80vw;
    max-width: 280px;
    transition: right 0.3s ease !important;
  }
  .sidebar-business.open {
    right: 0 !important;
    left: auto !important;
  }

  .product-main-content {
    padding: 16px;
  }

  .hero_agent {
    padding: 40px 20px 36px;
  }
  .hero_agent h1 {
    font-size: clamp(1.5rem, 6vw, 2.4rem);
  }
  .hero-sub {
    font-size: 0.92rem;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-actions .btn-primary,
  .hero-actions .btn-secondary,
  .hero-actions button {
    width: 100%;
    text-align: center;
  }

  .value-strip {
    flex-wrap: wrap;
  }
  .value-item {
    flex: 1 1 calc(50% - 1px);
    min-width: 0;
    padding: 16px 12px;
  }
  .value-num {
    font-size: 1.5rem;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    min-width: 600px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .guarantee {
    padding: 28px 20px;
  }

  .team-grid {
    gap: 14px;
  }
  .team-card {
    padding: 20px 24px;
    min-width: 130px;
  }

  .cta-section {
    padding: 50px 20px;
  }
  .cta-section h2 {
    font-size: clamp(1.5rem, 5vw, 2.4rem);
  }

  .section {
    padding: 48px 20px;
  }

  .footer {
    padding: 24px 16px 16px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .ai-footer {
    padding: 0;
  }
  .footer-right {
    padding: 12px;
  }

  .agent-details-header {
    padding: 28px 16px;
  }
  .agent-details-content {
    padding: 20px 16px;
  }
  .agent-hero {
    flex-direction: column;
    text-align: center;
  }
  .agent-hero-icon {
    width: 100px;
    height: 100px;
    font-size: 60px;
  }
  .agent-hero-info h1 {
    font-size: 28px;
  }
  .agent-meta {
    justify-content: center;
  }
  .action-buttons {
    flex-direction: column;
  }
  .btn-primary-agent,
  .btn-secondary-agent,
  .btn-trial-agent {
    width: 100%;
    justify-content: center;
  }
  .benefits-grid {
    grid-template-columns: 1fr;
  }
  .cta-box {
    padding: 32px 16px;
  }
  .cta-box h2 {
    font-size: 26px;
  }
  .btn-cta-large {
    width: 100%;
    justify-content: center;
    font-size: 16px;
  }

  .employee-form-container {
    padding: 20px;
  }
  .form-wrapper {
    padding: 16px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }

  #home-content {
    height: calc(100vh - 70px);
  }
}

/* ════════════════════════════════════════════════════════════
   BREAKPOINT 4: SMALL MOBILE  ≤ 480px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .logo-text {
    display: none;
  }
  .h-logo .logo img {
    height: 34px;
  }
  .h-contact {
    padding: 0 52px 6px 56px;
  }
  .h-actions {
    gap: 6px;
    padding: 0 8px;
  }

  /* Metrics stay as 5-col grid — just tighter */
  .h-metrics-row {
    grid-template-columns: repeat(5, 1fr) !important;
  }
  .metric-box {
    padding: 4px 2px;
  }
  .m-num {
    font-size: 10px;
  }
  .m-lbl {
    font-size: 6px;
  }

  .value-item {
    flex: 1 1 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
  .value-item:last-child {
    border-bottom: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .team-card {
    min-width: 100px;
    padding: 16px;
  }
  .team-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }

  .section {
    padding: 36px 16px;
  }
  .section-title {
    font-size: 1.6rem;
  }
}

/* ════════════════════════════════════════════════════════════
   UTILITY
   ════════════════════════════════════════════════════════════ */
img {
  max-width: 100%;
  height: auto;
}
iframe.content-view {
  max-width: 100%;
}
