/* ============================================================
   TVK Makkal Connect — Responsive / mobile styles
   ============================================================ */

/* ── Tablet (≤ 1024px) ──────────────────────────────────────── */
@media (max-width: 1024px) {
  /* Chat: hide right panel */
  .chat-panel { display: none; }

  /* Chat: hide left sidebar by default, show as drawer */
  .chat-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 300;
    transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-xl);
    width: 260px;
  }
  .chat-sidebar.sidebar--open { transform: translateX(0); }
  .sidebar-overlay.overlay--visible { display: block; }

  /* Chat header: show hamburger */
  .header-sidebar-toggle { display: flex; align-items: center; }
  .header-title-group p { display: none; }

  /* Hide some header buttons on tablet */
  .header-btn--hide-tablet { display: none; }

  /* WA page: stack controls below phone */
  .wa-page { flex-direction: column; align-items: center; padding: 16px; }
  .wa-controls { max-width: 390px; width: 100%; order: 2; }
  .wa-phone { order: 1; }
}

/* ── Mobile (≤ 640px) ───────────────────────────────────────── */
@media (max-width: 640px) {
  /* ── Home page ── */
  .home-grid { grid-template-columns: 1fr !important; }
  .home-hero-title { font-size: 28px !important; }
  .home-header { padding: 0 14px; }
  .home-main { padding: 20px 16px 80px; gap: 24px; }
  .home-footer { padding: 24px 16px; }
  .home-card { padding: 20px; }

  /* ── Chat page ── */
  .chat-header { padding: 0 12px; height: 54px; }
  .header-brand { gap: 8px; }
  .header-logo { width: 32px; height: 32px; }
  .header-title-group h1 { font-size: 14px; }
  .header-actions { gap: 4px; }
  .header-btn { padding: 5px 8px; font-size: 11px; }
  .header-btn span.text-label { display: none; }

  /* Show bottom nav on mobile */
  .chat-bottom-nav { display: flex; }

  /* Chat messages: more bottom padding for nav */
  .chat-messages { padding-bottom: 160px; }

  /* Input bar adjustments */
  .chat-input-bar { padding: 8px 10px 12px; }

  /* Bubbles: allow wider */
  .bubble { max-width: 88%; font-size: 14px; }

  /* Ticket draft card wider on mobile */
  .ticket-draft-card { max-width: 100%; }

  /* ── WhatsApp page ── */
  .wa-phone {
    width: 100%; max-width: 100%;
    border-radius: 24px; border-width: 8px; height: auto;
    min-height: 580px; max-height: 70vh;
  }
  .wa-controls { padding: 0; }
  .wa-controls__title { font-size: 18px; }

  /* Modal full-screen on mobile */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: var(--r-2xl) var(--r-2xl) 0 0;
    max-width: 100%; padding: 24px 20px 32px; max-height: 85vh;
  }
}

/* ── Very small phones (≤ 380px) ───────────────────────────── */
@media (max-width: 380px) {
  .header-badge { display: none; }
  .header-btn { padding: 5px 6px; }
  .wa-phone { height: 60vh; }
}

/* ── Large screens (≥ 1280px): show right panel ─────────────── */
@media (min-width: 1280px) {
  .chat-panel { display: flex; flex-direction: column; }
}

/* ── Print / reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
