/* ══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — IPScanner.in
   Breakpoints: 768px (tablet), 480px (phone)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Hamburger Button ──────────────────────────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─────────────────────────────────────────────────────────────────────────
   TABLET (≤768px)
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Hamburger visible */
  .hamburger { display: flex; }

  /* Nav becomes slide-down overlay */
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 4px;
    z-index: 999;
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
    border-radius: 0 0 16px 16px;
    order: unset;
    width: auto;
    border-top: none;
    padding-top: 16px;
  }
  .main-nav.mobile-open { display: flex; }

  .main-nav a {
    padding: 12px 16px;
    font-size: 15px;
    border-radius: 8px;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    justify-content: flex-start;
    transition: background 0.2s, color 0.2s;
  }
  .main-nav a:hover, .main-nav a.active {
    background: rgba(255,255,255,0.04);
    box-shadow: none;
    transform: none;
    color: var(--accent);
  }
  .main-nav a.active::after { display: none; }

  /* Header layout */
  header {
    padding: 16px 0;
    position: relative;
  }

  .header-controls { gap: 10px; }

  /* Hero */
  .hero { padding: 40px 0 32px; }
  .hero h1 { font-size: clamp(28px, 7vw, 42px); letter-spacing: -1px; }
  .hero p { font-size: 14px; margin-bottom: 28px; }

  /* Search box */
  .search-box {
    max-width: 100%;
    flex-direction: column;
    border-radius: 14px;
  }
  .search-box input {
    padding: 16px 18px;
    font-size: 14px;
    width: 100%;
    text-align: center;
  }
  .search-btn {
    margin: 0 12px 12px;
    padding: 14px;
    width: calc(100% - 24px);
    font-size: 14px;
    border-radius: 10px;
  }

  /* Container padding */
  .container { padding: 0 16px; }

  /* Tool Links row */
  .hero .flex.flex-wrap {
    gap: 6px;
  }

  /* Educational sections */
  .edu-card, .blog-rich-card {
    padding: 24px 20px;
  }

  /* Result cards */
  .card-inner:hover { transform: none; }
  .p-row { padding: 10px 16px; gap: 8px; }
  .p-label { font-size: 11px; }
  .p-value { font-size: 12px; }
  .card-header { padding: 16px 16px 12px; }
  .card-icon { width: 32px; height: 32px; border-radius: 10px; }

  /* Summary module */
  .summary-module { padding: 20px !important; flex-direction: column !important; }
  .stat-pill { padding: 10px 20px; min-width: 70px; }

  /* Loading/terminal */
  .terminal-box { height: 110px; }
  .terminal-line { font-size: 10px; }

  /* Detail sections */
  .detail-section { padding: 20px; }
  .ai-section { padding: 20px; }
  .categories-section { padding: 0 20px 20px; }

  /* Modal */
  .modal-header { padding: 16px 20px; }
  .modal-body { padding: 20px; }
  .modal-title { font-size: 17px; }

  /* Footer */
  footer { padding: 28px 0; margin-top: 28px; }
  .footer-links { gap: 12px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   PHONE (≤480px)
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {

  /* Even tighter spacing */
  .container { padding: 0 12px; }
  header { gap: 10px; }

  /* Logo */
  .logo-text { font-size: 18px; }
  .logo-icon { width: 28px; height: 28px; }
  .badge { font-size: 8px; padding: 2px 6px; margin-left: 6px !important; }

  /* Clock */
  .clock { font-size: 11px; padding: 3px 8px; }
  .theme-toggle { width: 30px; height: 30px; }

  /* Hero */
  .hero { padding: 28px 0 24px; }
  .hero h1 { font-size: clamp(24px, 8vw, 36px); }
  .hero p { font-size: 13px; max-width: 300px; }
  .hero-eyebrow { font-size: 9px; letter-spacing: 2px; }

  /* Diagnostic links */
  .hero a[href] { font-size: 11px; }

  /* Search */
  .search-box input { padding: 14px 16px; font-size: 13px; }
  .search-btn { padding: 12px; font-size: 13px; }

  /* Stats grid */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-cell { padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--border); }
  .stat-value { font-size: 14px; }
  .stat-label { font-size: 8px; }

  /* Result cards */
  .p-row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .p-value { text-align: left; }
  .card-title { font-size: 10px; }

  /* Score ring (IP scanner) */
  .score-ring-container { width: 90px; height: 90px; }
  .score-number { font-size: 28px; }

  /* Detail tables */
  .detail-row { padding: 10px 14px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .detail-label { font-size: 10px; }
  .detail-value { font-size: 12px; text-align: left; }

  /* Terminal */
  .terminal-box { height: 90px; padding: 10px; }
  .terminal-line { font-size: 9px; gap: 4px; }

  /* Ad placeholders */
  .ad-placeholder.h-banner { height: 180px; }
  .ad-placeholder.in-content { height: 200px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   SSL CHECKER — Mobile Overrides
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ssl-premium-layout { gap: 16px; margin-top: 24px; }

  .ssl-status-banner { padding: 20px; border-radius: 16px; }
  .ssl-status-icon { width: 48px; height: 48px; border-radius: 12px; }
  .ssl-status-icon svg { width: 24px; height: 24px; }
  .ssl-status-title { font-size: 16px; }
  .ssl-status-desc { font-size: 12px; }
  .ssl-status-badge { font-size: 9px; padding: 6px 14px; }

  .ssl-score-section {
    grid-template-columns: 1fr;
    padding: 24px 20px;
    gap: 20px;
    justify-items: center;
    text-align: center;
  }
  .ssl-score-ring-wrap { width: 130px; height: 130px; }
  .ssl-score-number { font-size: 34px; }
  .ssl-grade { margin: 0 auto 12px; }
  .ssl-quick-stats { flex-direction: row; gap: 8px; width: 100%; }
  .ssl-stat-card { flex: 1; padding: 12px 10px; }
  .ssl-stat-num { font-size: 20px; }

  .ssl-details-section,
  .ssl-tls-section,
  .ssl-chain-section,
  .ssl-insights-section,
  .ssl-alerts-section,
  .ssl-advanced-section { padding: 20px; border-radius: 16px; }

  .ssl-cert-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .ssl-cert-label { min-width: unset; font-size: 10px; }
  .ssl-cert-value { font-size: 13px; text-align: left; }
  .ssl-cert-value-wrap { justify-content: flex-start; }

  .ssl-tls-grid { grid-template-columns: 1fr; }

  .ssl-insight { padding: 10px 12px; font-size: 12px; }
  .ssl-alert { font-size: 12px; padding: 10px 14px; }

  .ssl-section-header { font-size: 11px; margin-bottom: 14px; }
}

@media (max-width: 480px) {
  .ssl-status-inner { flex-direction: column; text-align: center; gap: 12px; }
  .ssl-status-badge { align-self: center; }
  .ssl-score-ring-wrap { width: 110px; height: 110px; }
  .ssl-score-number { font-size: 28px; }
  .ssl-quick-stats { flex-direction: column; }
  .ssl-breakdown-item { font-size: 11px; }
  .ssl-chain-visual { padding-left: 4px; }
  .ssl-chain-text { font-size: 11px; }

  .ssl-adv-row { flex-direction: column; gap: 4px; }
  .ssl-adv-value { text-align: left; font-size: 11px; }
  .ssl-san-tags { justify-content: flex-start; }
}

/* ─────────────────────────────────────────────────────────────────────────
   SCROLL LOCK WHEN NAV OPEN
   ───────────────────────────────────────────────────────────────────────── */
body.nav-open { overflow: hidden; }

/* ─────────────────────────────────────────────────────────────────────────
   TOUCH IMPROVEMENTS
   ───────────────────────────────────────────────────────────────────────── */
@media (pointer: coarse) {
  .search-btn { min-height: 48px; }
  .main-nav a { min-height: 44px; display: flex; align-items: center; }
  .footer-link { min-height: 44px; display: flex; align-items: center; }
  .theme-toggle { min-width: 44px; min-height: 44px; }
  .ssl-copy-btn { min-width: 36px; min-height: 36px; font-size: 14px; }
}

/* ── Prevent horizontal overflow globally ──────────────────────────────── */
html, body { overflow-x: hidden; max-width: 100vw; }
img, video, iframe, canvas, svg { max-width: 100%; height: auto; }
