/* ═══════════════════════════════════════════════
   CIVICCARE MOBILE CSS - Complete Fix v2
   ═══════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box !important; }
html, body { max-width: 100vw !important; overflow-x: hidden !important; }

/* ── DRAWER OVERLAY ── */
#drawerOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 998;
}
#drawerOverlay.open { display: block; }

/* ── SIDE DRAWER ── */
#mobileDrawer {
  position: fixed;
  top: 0;
  left: -280px;
  width: 270px;
  height: 100vh;
  background: #0d1b2a;
  z-index: 999;
  transition: left 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.4);
}
#mobileDrawer.open { left: 0 !important; }

.drawer-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: #0d1b2a;
}
.drawer-header img { height: 36px; width: auto; }
.drawer-header span {
  font-family: 'DM Sans', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
}
.drawer-user {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #0d1b2a;
}
.drawer-user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #1a56db;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.drawer-user-name { font-size: 0.88rem; font-weight: 600; color: #fff; }
.drawer-user-email { font-size: 0.73rem; color: rgba(255,255,255,0.45); margin-top: 1px; }

.drawer-nav {
  padding: 0.6rem;
  display: flex; flex-direction: column; gap: 2px;
  background: #0d1b2a;
}
.drawer-nav a {
  display: flex !important; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: rgba(255,255,255,0.75) !important;
  text-decoration: none !important;
  font-size: 0.9rem; font-weight: 500;
  transition: all 0.15s;
  background: transparent;
}
.drawer-nav a:hover, .drawer-nav a.active {
  background: #1a56db !important;
  color: #fff !important;
}
.drawer-nav a i { font-size: 1.05rem; width: 22px; flex-shrink: 0; color: inherit !important; }
.drawer-divider { margin: 0.4rem 0; border-top: 1px solid rgba(255,255,255,0.08); }
.drawer-nav a.logout-link { color: #fc8181 !important; }
.drawer-nav a.logout-link:hover { background: rgba(239,68,68,0.15) !important; }

/* ── HAMBURGER ── */
#hamburgerBtn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none !important;
  border: none !important;
  cursor: pointer;
  padding: 8px;
  margin-right: 4px;
  flex-shrink: 0;
  z-index: 10;
}
#hamburgerBtn span {
  display: block;
  width: 22px; height: 2px;
  background: #0d1b2a;
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════
   MOBILE STYLES
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Show hamburger, hide sidebar */
  #hamburgerBtn { display: flex !important; }
  .sidebar { display: none !important; }

  /* Fix main layout */
  #mainLayout { display: block !important; }
  .flex-grow-1 { width: 100% !important; min-width: 0 !important; }

  /* Navbar */
  .navbar {
    padding: 0 0.6rem !important;
    height: 56px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
  }
  .navbar .container-fluid { flex-wrap: nowrap !important; gap: 2px; }
  .navbar-brand img { height: 30px !important; }
  .navbar-brand span { font-size: 0.95rem !important; }
  .navbar form { display: none !important; }
  #navUserName { display: none !important; }

  /* All main areas full width */
  .dashboard-main, .complaint-main, .track-main,
  .notif-main, .profile-main {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 0.85rem !important;
    overflow-x: hidden !important;
  }

  /* Bootstrap columns - all full width */
  .col-lg-8, .col-lg-4, .col-lg-6, .col-lg-3,
  .col-md-4, .col-md-8, .col-md-6, .col-md-7, .col-md-5 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  /* Cards */
  .card { border-radius: 12px !important; }
  .card-body { padding: 1rem !important; }
  .stat-card h2 { font-size: 1.8rem !important; }

  /* FIX: Raise a New Complaint button - make it full width and visible */
  .stat-card .btn {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
  }

  /* Table */
  .table-responsive { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
  .table th, .table td { font-size: 0.75rem !important; padding: 0.45rem 0.35rem !important; }

  /* Category grid */
  .category-grid { grid-template-columns: 1fr 1fr !important; gap: 0.5rem !important; }
  .cat-btn { font-size: 0.78rem !important; padding: 0.5rem !important; }

  /* Steps */
  .steps-bar { margin-bottom: 1rem !important; }
  .step-label { font-size: 0.58rem !important; }
  .step-dot { width: 20px !important; height: 20px !important; font-size: 0.62rem !important; }

  /* Forms */
  .form-control, .form-select {
    font-size: 0.88rem !important;
    padding: 0.6rem 0.85rem !important;
  }

  /* FIX: Login form - icon overlapping fix */
  .input-icon-wrap .form-control {
    padding-left: 2.4rem !important;
  }

  /* FIX: Search box in admin - icon overlapping fix */
  .search-box input {
    padding-left: 2.2rem !important;
    width: 100% !important;
  }

  /* Buttons */
  .btn { font-size: 0.85rem !important; }

  /* Row gaps */
  .row.g-4 { --bs-gutter-x: 0.65rem; --bs-gutter-y: 0.65rem; }
  .mb-4 { margin-bottom: 0.85rem !important; }

  /* No overflow */
  img { max-width: 100% !important; }
  input, select, textarea, button { max-width: 100% !important; }

  /* Filter bar on track */
  .filter-bar { gap: 0.35rem !important; flex-wrap: wrap !important; }
  .filter-btn { padding: 0.3rem 0.65rem !important; font-size: 0.78rem !important; }
  .search-wrap { max-width: 100% !important; width: 100% !important; }

  /* Profile */
  .profile-header-card { padding: 1.25rem !important; }
  .mini-stat-row { gap: 0.5rem !important; }

  /* Notification */
  .notif-item { padding: 0.9rem 1rem !important; }
  .filter-pills { gap: 0.35rem !important; flex-wrap: wrap !important; }
  .filter-pill { padding: 0.3rem 0.75rem !important; font-size: 0.78rem !important; }

  /* Guided questions */
  .q-opt { font-size: 0.75rem !important; padding: 0.25rem 0.6rem !important; }

  /* Admin panel mobile fixes */
  .stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem !important;
  }
  .filter-row {
    flex-direction: column !important;
    gap: 0.5rem !important;
    align-items: stretch !important;
  }
  .filter-row > * { width: 100% !important; }
  .filter-row .search-box { width: 100% !important; }
  .filter-row select { width: 100% !important; }

  /* Admin date filters - 2 per row */
  .date-filter-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    align-items: center !important;
  }
}

/* ═══════════════════════════════════════════════
   INDEX PAGE FIXES
   ═══════════════════════════════════════════════ */

/* Fix CivicCare brand - make Civic and Care same size/color */
.navbar-brand.brand {
  font-size: 1.3rem !important;
}
.navbar-brand.brand span {
  font-size: 1.3rem !important;
  font-family: 'DM Sans', sans-serif !important;
}

/* Hide AI-POWERED badge on index */
.section-eyebrow-badge,
.hero-badge {
  display: none !important;
}

@media (max-width: 768px) {
  .navbar-brand.brand { font-size: 1.1rem !important; }
  .navbar-brand.brand span { font-size: 1.1rem !important; }

  /* Fix Bootstrap collapse menu on mobile (index.html) */
  .navbar-collapse {
    background: rgba(255, 255, 255, 0.98) !important;
    position: absolute !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    padding: 1.25rem !important;
    border-bottom: 1.5px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(13, 27, 42, 0.15) !important;
    z-index: 1000 !important;
    border-radius: 0 0 16px 16px !important;
  }
  .navbar-collapse .navbar-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .navbar-collapse .nav-item {
    width: 100% !important;
    text-align: center !important;
  }
  .navbar-collapse .nav-link {
    color: #1e293b !important;
    padding: 0.5rem 0 !important;
    display: block !important;
  }
  .navbar-collapse .btn-nav {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    margin: 0.25rem 0 0 !important;
  }
}