/* ============================================================
   VotelKart — Mobile App Layer
   Makes the site feel like a native app on phones & tablets
   Import AFTER style.css
   ============================================================ */

/* ── PWA / App Shell Meta ─────────────────────────────────── */
:root {
  --safe-top:     env(safe-area-inset-top, 0px);
}

/* ============================================================
   PHONE  ≤ 768px
   ============================================================ */
@media (max-width: 768px) {

  /* ── App shell: full-height, no horizontal scroll ────────── */
  html, body {
    height: 100%;
    overscroll-behavior-y: contain;
  }

  body {
    padding-bottom: 0;
  }

  /* ── Sticky navbar → compact app header ──────────────────── */
  .navbar {
    height: 56px;
    padding-top: var(--safe-top);
    z-index: 400;  /* above footer inline <style> overrides */
  }
  .nav-inner {
    height: 56px;
    padding: 0 16px;
  }
  .brand { font-size: 21px; }

  /* Hamburger → visually cleaner toggle */
  .nav-toggle {
    width: 36px;
    height: 36px;
    gap: 4px;
    padding: 4px;
  }

  /* Full-screen dropdown feels native */
  .nav-links {
    top: 56px !important;   /* navbar is 56px on mobile, not 68px */
    padding: 0 0 20px;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    z-index: 400 !important; /* above footer inline styles */
  }
  .nav-links a {
    padding: 16px 24px;
    font-size: 15px;
    border-bottom: 1px solid rgba(255,255,255,.05);
  }


  /* ── Main wrap: shrink top padding (nav is only 56px) ────── */
  .main-wrap {
    padding: 16px 14px 32px;
    min-height: calc(100vh - 56px);
  }

  /* ── Hero → compact app banner ───────────────────────────── */
  .hero {
    padding: 36px 20px 32px;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
  }
  .hero h1 { font-size: clamp(28px, 7vw, 38px); margin-bottom: 12px; }
  .hero p  { font-size: 14px; margin-bottom: 22px; }

  /* ── Search box → app card ────────────────────────────────── */
  .search-box {
    padding: 18px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
  }

  /* ── Property cards → swipeable feel ─────────────────────── */
  .property-grid { gap: 14px; }
  .property-card {
    border-radius: var(--radius-lg);
    /* No hover lift on touch — use active instead */
    transition: transform .12s, box-shadow .12s;
  }
  .property-card:active {
    transform: scale(.985);
    box-shadow: var(--shadow-sm);
  }
  .property-card:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--frost); }
  .property-img, .property-img-placeholder { height: 185px; }
  .property-body { padding: 16px 18px 18px; }
  .property-name { font-size: 18px; }

  /* ── Cards → app card style (larger radius, softer) ──────── */
  .card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }
  .card-body   { padding: 18px 16px; }
  .card-header { padding: 14px 16px; font-size: 17px; }

  /* ── Stat cards → 2-up grid, pill-style ──────────────────── */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat-card  { padding: 16px 14px; border-radius: var(--radius-lg); }
  .stat-value { font-size: 26px; }
  .stat-label { font-size: 10px; }

  /* ── Buttons → bigger tap targets ────────────────────────── */
  .btn {
    min-height: 46px;
    border-radius: var(--radius-lg);
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
  }
  .btn:active { transform: scale(.97); opacity: .92; }
  .btn-sm {
    min-height: 36px;
    font-size: 13px;
    border-radius: var(--radius);
  }

  /* ── Form controls → native-feeling ──────────────────────── */
  .form-control {
    padding: 13px 14px;
    font-size: 16px; /* prevents iOS zoom on focus */
    border-radius: var(--radius);
    min-height: 48px;
  }
  .form-group label { font-size: 11px; }

  /* ── Auth pages → full-bleed app screen ──────────────────── */
  .auth-wrap {
    margin: 0;
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .auth-card { border-radius: var(--radius-xl); box-shadow: var(--shadow-md); }
  .auth-header { padding: 28px 22px 20px; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .auth-header h1 { font-size: 24px; }
  .auth-body   { padding: 22px; }

  /* ── Dashboard sidebar → collapsible drawer ──────────────── */
  .dash-layout { gap: 12px; }
  .sidebar {
    border-radius: var(--radius-lg);
    margin-bottom: 0;
  }
  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius-lg);
    font-size: 15px;
    padding: 14px 18px;
  }
  .sidebar-toggle::after {
    content: '▾';
    font-size: 16px;
    transition: transform .2s;
  }
  .sidebar-toggle.open::after { transform: rotate(180deg); }
  .sidebar-nav a {
    padding: 15px 18px;
    font-size: 15px;
  }

  /* ── Summary box → cleaner mobile layout ─────────────────── */
  .summary-box { padding: 18px 16px; border-radius: var(--radius-lg); }
  .summary-row { font-size: 13px; padding: 8px 0; }
  .summary-row:last-child { font-size: 16px; }

  /* ── Page titles ──────────────────────────────────────────── */
  .page-title { font-size: 22px; margin-bottom: 4px; }
  .page-sub   { font-size: 13px; margin-bottom: 20px; }

  /* ── Features strip ───────────────────────────────────────── */
  .features-strip { padding: 32px 16px; border-radius: var(--radius-lg); }

  /* ── Pull-to-refresh indicator style ─────────────────────── */
  .ptr-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    color: var(--slate);
    font-size: 13px;
    gap: 8px;
  }

  /* ── Toast notifications (app-like) ──────────────────────── */
  .toast {
    position: fixed;
    bottom: 24px;
    left: 16px;
    right: 16px;
    background: var(--charcoal);
    color: var(--white);
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    z-index: 600;
    box-shadow: var(--shadow-lg);
    animation: toast-in .25s ease;
  }
  @keyframes toast-in {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  /* ── Alerts → compact app banner style ───────────────────── */
  .alert {
    border-radius: var(--radius-lg);
    font-size: 13px;
    padding: 12px 14px;
  }

  /* ── Table → always use mobile-card on phone ──────────────── */
  .table-wrap table { display: none; }
  .mobile-card { display: block; }
  .mobile-card { border-radius: var(--radius-lg); padding: 16px 14px; }

  /* ── Badges → slightly larger for touch ──────────────────── */
  .badge { padding: 5px 12px; font-size: 12px; }

  /* ── Footer visible on mobile ────────────────────────────── */

  /* ── Smooth momentum scrolling ───────────────────────────── */
  .main-wrap,
  .table-wrap,
  .sidebar-nav {
    -webkit-overflow-scrolling: touch;
  }

  /* ── Active state for all tappable elements ───────────────── */
  a:active, button:active { opacity: .75; }
}


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

  /* Hide bottom nav on tablet */
  /* ── Navbar ───────────────────────────────────────────────── */
  .nav-inner { padding: 0 24px; height: 62px; }

  /* ── Main wrap ────────────────────────────────────────────── */
  .main-wrap { padding: 28px 24px 64px; }

  /* ── Hero → tablet proportions ───────────────────────────── */
  .hero { padding: 64px 40px; margin-bottom: 36px; border-radius: var(--radius-xl); }

  /* ── Property grid → 2 columns on tablet ─────────────────── */
  .property-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .property-img, .property-img-placeholder { height: 195px; }

  /* ── Stats → 2-up ────────────────────────────────────────── */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  /* ── Sidebar → narrower on tablet ────────────────────────── */
  .sidebar { width: 220px; top: 80px; }

  /* ── Auth wrap ────────────────────────────────────────────── */
  .auth-wrap { margin: 32px auto; }

  /* ── Footer → 2-col on tablet ────────────────────────────── */
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; padding: 40px 24px; }


  /* ── Buttons → slightly larger tap targets ────────────────── */
  .btn { min-height: 44px; }
  .form-control {
    font-size: 16px;
    min-height: 46px;
  }

  /* ── Search grid → tablet layout ─────────────────────────── */
  .search-box { padding: 22px 24px; }
  .search-grid { grid-template-columns: repeat(3, 1fr); }
  .search-grid .form-group:last-child { grid-column: auto; }

  /* ── Tablet card style ────────────────────────────────────── */
  .card-body   { padding: 22px; }
  .card-header { padding: 16px 22px; }

  /* ── Bottom nav hidden; keep table view ──────────────────── */
  .table-wrap table { display: table; }
  .mobile-card { display: none; }
}


/* ============================================================
   SHARED MOBILE + TABLET UTILITIES
   ============================================================ */
@media (max-width: 1024px) {

  /* Smooth, app-like page transitions */
  .main-wrap { animation: page-in .22s ease-out; }
  @keyframes page-in {
    from { opacity: .6; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Input focus: no box-shadow glow on touch (feels unnatural) */
  @media (hover: none) {
    .form-control:focus { box-shadow: none; border-color: var(--sapphire); }
    .btn:hover { transform: none; }
    .property-card:hover { transform: none; box-shadow: var(--shadow-sm); }
  }

  /* Larger checkbox / radio targets */
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
  }

  /* Skeleton loading shimmer (add class .skeleton to placeholders) */
  .skeleton {
    background: linear-gradient(90deg, var(--ice) 25%, var(--frost) 50%, var(--ice) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: var(--radius);
  }
  @keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
  }
}

/* ============================================================
   REDUCED MOTION — respect user preference
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   FOOTER CARD STYLES
   ============================================================ */

/* ── Footer reset ──────────────────────────────────────────── */
.footer {
  background:  var(--midnight);
  margin-top:  64px;
  border-top:  1px solid rgba(255,255,255,.07);
  color:       rgba(255,255,255,.75);
}

/* ── Card grid ─────────────────────────────────────────────── */
.footer-top {
  max-width: 1320px;
  margin:    0 auto;
  padding:   48px 28px 40px;
  display:   grid;
  grid-template-columns: 1.8fr 1fr 1.2fr;
  gap:       24px;
}

/* ── Individual card ───────────────────────────────────────── */
.footer-card {
  background:    rgba(255,255,255,.04);
  border:        1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  padding:       24px;
}

/* Brand card */
.footer-card-brand {
  background: linear-gradient(135deg, rgba(30,111,217,.18) 0%, rgba(255,255,255,.03) 100%);
  border-color: rgba(30,111,217,.25);
}
.footer-logo {
  font-family:   var(--font-head);
  font-size:     28px;
  font-weight:   700;
  color:         var(--white);
  margin-bottom: 10px;
}
.brand-v { color: var(--sapphire); font-style: italic; }
.footer-tagline {
  font-size:     13px;
  opacity:       .55;
  line-height:   1.7;
  margin-bottom: 20px;
  font-weight:   300;
}
.footer-email-btn {
  display:       inline-block;
  padding:       9px 16px;
  background:    rgba(30,111,217,.20);
  border:        1px solid rgba(30,111,217,.35);
  border-radius: var(--radius);
  font-size:     13px;
  color:         rgba(255,255,255,.85);
  transition:    background .2s, border-color .2s;
  font-weight:   500;
}
.footer-email-btn:hover {
  background:   rgba(30,111,217,.35);
  border-color: rgba(30,111,217,.6);
  color:        var(--white);
}

/* Card heading */
.footer-card-title {
  font-size:      11px;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color:          var(--sapphire);
  margin-bottom:  16px;
  padding-bottom: 10px;
  border-bottom:  1px solid rgba(255,255,255,.08);
}

/* Links list */
.footer-card-links {
  list-style: none;
  padding:    0;
  margin:     0;
}
.footer-card-links li { margin-bottom: 2px; }
.footer-card-links a {
  display:       flex;
  align-items:   center;
  gap:           8px;
  padding:       9px 10px;
  border-radius: var(--radius-sm);
  font-size:     13px;
  color:         rgba(255,255,255,.65);
  transition:    background .18s, color .18s;
  font-weight:   400;
}
.footer-card-links a:hover {
  background: rgba(255,255,255,.07);
  color:      var(--white);
}

/* Commission mini-card */
.footer-commission-card {
  margin-top:    16px;
  padding:       12px 14px;
  background:    rgba(255,255,255,.04);
  border:        1px solid rgba(255,255,255,.07);
  border-radius: var(--radius);
}
.footer-commission-row {
  display:         flex;
  justify-content: space-between;
  font-size:       12px;
  padding:         4px 0;
  border-bottom:   1px solid rgba(255,255,255,.05);
  gap:             8px;
}
.footer-commission-row:last-child { border-bottom: none; }
.footer-commission-row span:first-child { opacity: .55; }
.footer-commission-val { font-weight: 600; color: rgba(255,255,255,.8); }
.footer-commission-gst .footer-commission-val { color: var(--sapphire); }

/* Bottom bar */
.footer-bottom {
  text-align:  center;
  padding:     16px 20px;
  border-top:  1px solid rgba(255,255,255,.07);
  font-size:   12px;
  opacity:     .35;
  letter-spacing: .3px;
}

/* ── Tablet ≤ 1024px ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    padding: 36px 20px 28px;
    gap: 16px;
  }
  .footer-card-brand { grid-column: 1 / -1; }
}

/* ── Mobile ≤ 768px ────────────────────────────────────────── */
@media (max-width: 768px) {
  .footer { display: block !important; margin-top: 40px; }
  .footer-top {
    grid-template-columns: 1fr;
    padding: 20px 16px 16px;
    gap:     12px;
  }
  .footer-card-brand { grid-column: auto; }
  .footer-card { padding: 18px 16px; border-radius: var(--radius-lg); }
  .footer-logo { font-size: 24px; }
  .footer-tagline { font-size: 12px; margin-bottom: 14px; }
  .footer-email-btn { font-size: 12px; padding: 8px 14px; width: 100%; text-align: center; display: block; }
  .footer-card-links a { padding: 10px 8px; font-size: 14px; }
  .footer-bottom { padding: 14px 16px; font-size: 11px; }
}

/* ── Print ─────────────────────────────────────────────────── */
@media print {
  .footer { display: none !important; }
}
