/* ================================================================
   Bangladesh Police Portal — Main Stylesheet
   Fonts: Cinzel (headings) + DM Sans (body)
================================================================ */

@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@600&family=DM+Sans:wght@300;400;500;600&display=swap");

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --navy: #0d1117;
  --navy-light: #161b22;
  --navy-border: rgba(0, 255, 136, 0.1);
  --navy-deep: #010409;

  /* গ্লোয়িং নিয়ন গ্রিন (ইমেজের গ্রাফ এবং আইকন থেকে) */
  --green: #00d78f;
  --green-light: #34d399;
  --green-pale: rgba(64, 249, 187, 0.1);

  /* টিয়াল এবং সাইয়ান শেড (Severity Distribution চার্ট থেকে) */
  --accent: #22d3ee;
  --accent-light: #818cf8;

  /* টেক্সট কালার */
  --text-light: #e6edf3;
  --text-muted: #8b949e;

  /* ব্যাকগ্রাউন্ড ও সারফেস */
  --body-bg: #ffffff;
  --surface: #ffffff;

  /* শ্যাডো ও গ্লো (ইমেজের মতো ভাইব আনতে) */
  --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 0 15px rgba(64, 249, 187, 0.15);

  --border: #22d3ee61;

  --transition: 0.25s ease-in-out;
}
/* ── Reset ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background: var(--body-bg);
  color: #1a2a3a;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}
a {
  text-decoration: none;
}
button {
  font-family: inherit;
  cursor: pointer;
}
input::placeholder {
  color: rgb(236, 0, 0);
}
/* ── Layout wrapper ─────────────────────────────────────────── */
.wrapper {
  display: flex;
  min-height: 100vh;
}

/* ================================================================
   SIDEBAR
================================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition:
    width var(--transition),
    transform var(--transition);
  z-index: 200;
  scrollbar-width: thin;
  scrollbar-color: var(--navy-border) transparent;
}
.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--navy-border);
  border-radius: 4px;
}

/* Collapsed (desktop) */
.sidebar.collapsed {
  width: var(--sidebar-w-col);
}
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-nav span,
.sidebar.collapsed .user-meta {
  display: none;
}
.sidebar.collapsed .sidebar-nav a {
  justify-content: center;
  padding: 13px;
  gap: 0;
}
.sidebar.collapsed .sidebar-nav a i {
  font-size: 20px;
  margin: 0;
}
.sidebar.collapsed .sidebar-footer {
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.sidebar.collapsed .police-logo {
  justify-content: center;
}

/* ── Sidebar Header ─────────────────────────────────────────── */
.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.police-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 19px;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(0, 106, 78, 0.4);
}

.logo-text {
  min-width: 0;
}

.logo-title {
  font-family: "Cinzel", serif;
  color: var(--text-light);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-sub {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Mobile close button inside sidebar */
.sidebar-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color var(--transition);
}
.sidebar-close-btn:hover {
  color: var(--text-light);
}

/* ── Nav items ──────────────────────────────────────────────── */
.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  list-style: none;
}

.nav-section-label {
  padding: 14px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-border);
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}

.sidebar-nav a:hover {
  color: var(--text-light);
  background: var(--navy-light);
}

.sidebar-nav a.active {
  color: var(--accent);
  background: rgba(212, 175, 55, 0.08);
  border-left-color: var(--accent);
}

.sidebar-nav a i {
  font-size: 16px;
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-nav a.active i {
  opacity: 1;
}

/* ── Sidebar Footer ─────────────────────────────────────────── */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--navy-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.user-avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.user-meta {
  min-width: 0;
}

.user-name {
  color: var(--text-light);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  color: var(--text-muted);
  font-size: 10.5px;
}

.btn-logout {
  color: var(--text-muted);
  font-size: 17px;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.btn-logout:hover {
  color: var(--danger);
  background: rgba(192, 57, 43, 0.1);
}

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 998;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.active {
  display: block;
}

/* ================================================================
   TOPBAR
================================================================ */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 22px;
  color: #6b7c93;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: var(--body-bg);
  color: var(--navy);
}

.topbar-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--navy);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.token-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.token-badge i {
  font-size: 14px;
}
.token-text {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
}

/* Flash wrapper */
.flash-wrapper {
  padding: 0 24px;
  margin-top: 16px;
}
.flash-wrapper:empty {
  display: none;
}

/* ================================================================
   MAIN CONTENT
================================================================ */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

.content-area {
  padding: 24px;
  flex: 1;
}

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}
.page-header p {
  color: #6b7c93;
  font-size: 13px;
  margin-top: 3px;
}

/* ================================================================
   CARDS
================================================================ */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
  transition:
    box-shadow var(--transition),
    transform var(--transition);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  margin-bottom: 12px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.stat-label {
  font-size: 12.5px;
  color: #6b7c93;
  margin-top: 4px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.card-header {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  padding: 13px 18px;
  font-weight: 600;
  font-size: 14px;
  border: none;
}

/* ================================================================
   FORMS
================================================================ */
.form-control,
.form-select {
  border: 1.5px solid #cdd5df;
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 14px;
  font-family: inherit;
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  background: var(--surface);
}
.form-control:focus,
.form-select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 106, 78, 0.12);
  outline: none;
}
.form-label {
  font-weight: 600;
  font-size: 12.5px;
  color: #3a4a5c;
  margin-bottom: 5px;
}
.form-text {
  font-size: 12px;
  color: #6b7c93;
  margin-top: 4px;
}

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--green-light);
  border-color: var(--green-light);
  box-shadow: 0 4px 14px rgba(0, 106, 78, 0.3);
}
.btn-navy {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
}
.btn-navy:hover {
  background: var(--navy-light);
  color: #fff;
}

/* ================================================================
   TABLES
================================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table thead th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
  border: none;
  white-space: nowrap;
  padding: 11px 14px;
}
.table tbody tr {
  transition: background var(--transition);
}
.table tbody tr:hover {
  background: #f5f8ff;
}
.table td,
.table th {
  vertical-align: middle;
  font-size: 13.5px;
  padding: 10px 14px;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge-pending {
  background: #fff3cd;
  color: #856404;
}
.badge-approved {
  background: #d1e7dd;
  color: #0f5132;
}
.badge-rejected {
  background: #f8d7da;
  color: #842029;
}

/* ================================================================
   AUTH PAGES (login / register / forgot password)
================================================================ */
.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(
      ellipse 70% 60% at 30% 20%,
      rgba(0, 106, 78, 0.25) 0%,
      transparent 60%
    ),
    linear-gradient(145deg, var(--navy-deep) 0%, var(--navy) 50%, #0d2545 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-box {
  background: var(--surface);
  border-radius: 18px;
  padding: 40px 36px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .shield {
  width: 68px;
  height: 68px;
  background: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 30px;
  color: var(--accent);
  box-shadow: 0 4px 20px rgba(10, 22, 40, 0.4);
}
.auth-logo h1 {
  font-family: "Cinzel", serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
}
.auth-logo p {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.btn-auth {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

/* ================================================================
   TOKEN CARD
================================================================ */
.token-card {
  background: var(--navy);
  color: #fff;
  border-radius: 18px;
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.token-card::before {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.12);
}
.token-card::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: -40px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(0, 106, 78, 0.2);
}
.token-amount {
  font-size: 46px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  position: relative;
  z-index: 1;
}
.token-label {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

/* ================================================================
   LAC CELL TOOL
================================================================ */
.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
#google-map {
  width: 100%;
  height: 460px;
}
.result-box {
  background: var(--green-pale);
  border: 1px solid #b7dfc9;
  border-radius: var(--radius-md);
  padding: 16px;
}
.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #d4edda;
  gap: 12px;
}
.result-item:last-child {
  border-bottom: none;
}
.result-key {
  font-size: 12.5px;
  color: #555;
  font-weight: 600;
  flex-shrink: 0;
}
.result-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  text-align: right;
  word-break: break-all;
}

/* ================================================================
   SUBSCRIPTION / PLAN CARDS
================================================================ */
.plan-card {
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 28px 22px;
  text-align: center;
  transition: all 0.28s;
  cursor: pointer;
  position: relative;
  background: var(--surface);
  height: 100%;
}
.plan-card:hover,
.plan-card.popular {
  border-color: var(--green);
  box-shadow: 0 8px 28px rgba(0, 106, 78, 0.14);
  transform: translateY(-3px);
}
.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #fff;
  padding: 3px 16px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.plan-price {
  font-size: 34px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  margin: 8px 0;
}
.plan-price span {
  font-size: 14px;
  font-weight: 400;
  color: #888;
}
.plan-tokens {
  font-size: 20px;
  font-weight: 600;
  color: var(--green);
  margin-bottom: 4px;
}

/* ================================================================
   PAYMENT MODAL
================================================================ */
.payment-logo {
  font-size: 38px;
  margin-bottom: 8px;
}
.payment-number {
  background: #f8f9fa;
  border: 2px dashed #adb5bd;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 3px;
}
.method-btn {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  background: var(--surface);
}
.method-btn.selected {
  border-color: var(--green);
  background: var(--green-pale);
}
.method-btn img {
  height: 34px;
  margin: 0 auto;
}

/* ================================================================
   ALERTS
================================================================ */
.alert {
  border-radius: var(--radius-md);
  font-size: 13.5px;
  border: none;
  padding: 12px 16px;
}
.alert-success {
  background: #d1e7dd;
  color: #0a3622;
}
.alert-danger {
  background: #f8d7da;
  color: #58151c;
}
.alert-warning {
  background: #fff3cd;
  color: #4d3a00;
}
.alert-info {
  background: #cff4fc;
  color: #055160;
}

/* ================================================================
   RESPONSIVE — MOBILE FIRST
================================================================ */

/* Tablet ≤ 992px */
@media (max-width: 992px) {
  .token-text {
    display: none;
  }
  #google-map {
    height: 380px;
  }
}

/* Mobile ≤ 768px */
@media (max-width: 768px) {
  /* Sidebar becomes off-canvas drawer */
  /* ================================================================
   MOBILE SIDEBAR — OVERLAY & SLIDE
================================================================ */

  /* Overlay — mobile এ sidebar এর পেছনে dark background */
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 998;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .sidebar-overlay.active {
    display: block;
  }

  @media (max-width: 768px) {
    /* Sidebar hidden by default on mobile */
    .sidebar {
      position: fixed;
      top: 0;
      left: 0;
      height: 100dvh;
      width: 260px !important;
      transform: translateX(-100%);
      transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      z-index: 999;
      box-shadow: none;
    }

    /* Sidebar open on mobile */
    .sidebar.mobile-open {
      transform: translateX(0);
      box-shadow: 4px 0 32px rgba(0, 0, 0, 0.35);
    }

    /* Collapsed class করবে না mobile এ */
    .sidebar.collapsed {
      width: 260px !important;
      transform: translateX(-100%);
    }
    .sidebar.collapsed.mobile-open {
      transform: translateX(0);
    }

    /* Sidebar nav text সবসময় দেখাবে */
    .sidebar.collapsed .logo-text,
    .sidebar.collapsed .sidebar-nav span,
    .sidebar.collapsed .user-meta {
      display: block !important;
    }
    .sidebar.collapsed .sidebar-nav a {
      justify-content: flex-start !important;
      padding: 11px 20px !important;
      gap: 11px !important;
    }
    .sidebar.collapsed .sidebar-nav a i {
      font-size: 16px !important;
      margin: 0 !important;
    }
    .sidebar.collapsed .police-logo {
      justify-content: flex-start !important;
    }
    .sidebar.collapsed .sidebar-footer {
      justify-content: flex-start !important;
    }

    /* Content area full width */
    .main-content {
      width: 100%;
    }
  }
  .content-area {
    padding: 16px;
  }
  .flash-wrapper {
    padding: 0 16px;
  }
  .topbar {
    padding: 0 14px;
    gap: 8px;
  }
  .topbar-title {
    font-size: 14px;
  }

  .auth-box {
    padding: 30px 22px;
  }

  .token-badge {
    padding: 5px 10px;
    font-size: 12px;
  }

  .stat-value {
    font-size: 22px;
  }

  .plan-card:hover {
    transform: none;
  }

  #google-map {
    height: 300px;
  }

  .result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .result-val {
    text-align: left;
  }
}

/* Small phones ≤ 480px */
@media (max-width: 480px) {
  .auth-box {
    padding: 24px 16px;
    border-radius: 14px;
  }
  .token-amount {
    font-size: 36px;
  }
  .plan-price {
    font-size: 28px;
  }
}

/* Safe area insets (notch/home bar) */
@supports (padding: max(0px)) {
  .topbar {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
  .sidebar {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .content-area {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

/* ================================================================
   UTILITIES
================================================================ */
.text-navy {
  color: var(--navy) !important;
}
.text-green {
  color: var(--green) !important;
}
.text-accent {
  color: var(--accent) !important;
}
.text-muted-soft {
  color: #6b7c93 !important;
}
.bg-navy {
  background: var(--navy) !important;
}
.bg-green {
  background: var(--green) !important;
}
.rounded-lg {
  border-radius: var(--radius-lg) !important;
}

/* Smooth focus rings for keyboard users */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 3px;
}
