/* ============================================================
   Police Patrol Management — Demo Website Stylesheet
   ============================================================ */

:root {
  --primary: #1e3c72;
  --primary-light: #2a5298;
  --accent: #667eea;
  --accent2: #764ba2;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Sarabun', 'Prompt', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── NAVBAR ── */
.demo-nav {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.demo-nav .nav-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.demo-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}
.demo-nav .brand i { font-size: 22px; }
.demo-nav .nav-badge {
  background: #f59e0b;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .5px;
}
.demo-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  flex-wrap: wrap;
}
.demo-nav .nav-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s, color .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.demo-nav .nav-links a:hover,
.demo-nav .nav-links a.active {
  background: rgba(255,255,255,0.18);
  color: white;
}
.demo-nav .nav-links a.active { font-weight: 700; }

/* ── DEMO BANNER ── */
.demo-banner {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: #1a0000;
  text-align: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .3px;
}
.demo-banner i { margin-right: 6px; }

/* ── MAIN CONTAINER ── */
main { flex: 1; }
.page-container {
  max-width: 1300px;
  margin: 28px auto;
  padding: 0 24px;
}

/* ── PAGE HEADER ── */
.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* ── CARDS ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: white;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 20px; }

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-card .stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-card .stat-num { font-size: 28px; font-weight: 800; line-height: 1; }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.stat-blue  { border-left-color: var(--info); }
.stat-blue .stat-icon { background: #eff6ff; color: var(--info); }
.stat-green { border-left-color: var(--success); }
.stat-green .stat-icon { background: #ecfdf5; color: var(--success); }
.stat-yellow { border-left-color: var(--warning); }
.stat-yellow .stat-icon { background: #fffbeb; color: var(--warning); }
.stat-red { border-left-color: var(--danger); }
.stat-red .stat-icon { background: #fef2f2; color: var(--danger); }
.stat-purple { border-left-color: var(--accent); }
.stat-purple .stat-icon { background: #f5f3ff; color: var(--accent); }

/* ── GRID LAYOUTS ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table.demo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.demo-table th {
  background: #f8f9fc;
  font-weight: 600;
  color: var(--text);
  padding: 12px 14px;
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.demo-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.demo-table tr:last-child td { border-bottom: none; }
.demo-table tr:hover td { background: #f9fafb; }

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-purple  { background: #ede9fe; color: #5b21b6; }
.badge-gray    { background: #f3f4f6; color: #374151; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  font-family: inherit;
  text-decoration: none;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: white; }
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,.4); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover  { background: #dc2626; }
.btn-secondary { background: #e5e7eb; color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }
.btn-outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: white; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 6px; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: white;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102,126,234,.12);
}
select.form-control { cursor: pointer; }

/* ── TABS ── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; gap: 0; flex-wrap: wrap; }
.tab-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--accent); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── MODALS ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlide .2s ease;
}
@keyframes modalSlide {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-header {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  padding: 16px 20px;
  border-radius: 16px 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
}
.modal-close {
  background: rgba(255,255,255,.2);
  border: none;
  color: white;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.modal-close:hover { background: rgba(255,255,255,.35); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── NOTIFICATION TOAST ── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: white;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  border-left: 4px solid var(--success);
  animation: toastIn .3s ease;
}
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--info); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast .toast-icon { font-size: 20px; }
.toast .toast-msg { font-size: 14px; flex: 1; }

/* ── LINE BOT SIMULATION ── */
.line-container {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.phone-frame {
  width: 360px;
  flex-shrink: 0;
  background: white;
  border-radius: 36px;
  border: 10px solid #1a1a1a;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  overflow: hidden;
  height: 680px;
  display: flex;
  flex-direction: column;
}
.phone-status {
  background: #06c755;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: white;
  font-weight: 600;
}
.chat-header {
  background: #06c755;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}
.chat-header .bot-avatar {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.chat-header h3 { font-size: 15px; font-weight: 700; margin: 0; }
.chat-header p  { font-size: 11px; margin: 0; opacity: .85; }
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  gap: 2px;
}
.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }
.chat-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}
.chat-msg.bot .chat-bubble  { background: white; border-radius: 4px 12px 12px 12px; }
.chat-msg.user .chat-bubble { background: #c8f3d7; border-radius: 12px 4px 12px 12px; color: #065f46; }
.chat-time { font-size: 11px; color: #999; }
.chat-msg.user .chat-time { text-align: right; }
.rich-menu-btn {
  display: inline-block;
  background: #06c755;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin: 3px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: background .2s;
}
.rich-menu-btn:hover { background: #05a847; }
.quick-reply-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.chat-input-area {
  background: #f5f5f5;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #e0e0e0;
}
.chat-input {
  flex: 1;
  border: 1.5px solid #ddd;
  border-radius: 22px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: white;
}
.chat-send {
  background: #06c755;
  border: none;
  color: white;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.chat-send:hover { background: #05a847; }
.line-steps {
  flex: 1;
}
.step-item {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  cursor: pointer;
  padding: 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  transition: all .2s;
  background: white;
}
.step-item:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(102,126,234,.15); }
.step-item.active { border-color: var(--accent); background: #f5f3ff; }
.step-num {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-content h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.step-content p  { font-size: 13px; color: var(--text-muted); }

/* ── MAP PLACEHOLDER ── */
.map-wrap {
  width: 100%;
  height: 340px;
  background: #e8f4f8;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.map-wrap iframe { width: 100%; height: 100%; border: none; }
.map-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f4f8 0%, #dbeafe 100%);
  color: var(--info);
  gap: 10px;
}
.map-placeholder i { font-size: 52px; opacity: .6; }
.map-placeholder p { font-size: 14px; color: var(--text-muted); }

/* ── OFFICER AVATAR ── */
.officer-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── PROGRESS BAR ── */
.progress-wrap {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--success));
  transition: width .5s ease;
}

/* ── SECTION DIVIDER ── */
.section-divider {
  margin: 28px 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* ── FOOTER ── */
.demo-footer {
  background: var(--primary);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 16px 20px;
  font-size: 13px;
  margin-top: auto;
}
.demo-footer span { color: white; font-weight: 600; }

/* ── HERO (landing) ── */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #3b5fc0 100%);
  padding: 80px 24px 70px;
  text-align: center;
  color: white;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-section .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  backdrop-filter: blur(4px);
}
.hero-section h1 {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
  position: relative;
}
.hero-section h1 .gradient-text {
  background: linear-gradient(90deg, #fbbf24, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-section p {
  font-size: 18px;
  opacity: .85;
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.6;
  position: relative;
}
.hero-section .hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  margin-bottom: 48px;
}
.hero-section .btn-hero {
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .2s;
}
.btn-hero-primary {
  background: #f59e0b;
  color: #1a0000;
  box-shadow: 0 4px 20px rgba(245,158,11,.4);
}
.btn-hero-primary:hover { background: #d97706; transform: translateY(-2px); }
.btn-hero-secondary {
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.5);
  color: white;
  backdrop-filter: blur(4px);
}
.btn-hero-secondary:hover { background: rgba(255,255,255,.25); }

/* ── DEMO CARDS GRID (landing) ── */
.demo-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 12px;
}
.demo-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1.5px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  transition: all .25s;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}
.demo-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.demo-card .demo-card-icon {
  width: 70px; height: 70px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 16px;
}
.demo-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.demo-card p  { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.demo-card .try-btn {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity .2s;
}
.demo-card:hover .try-btn { opacity: .9; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .line-container { flex-direction: column; align-items: center; }
  .phone-frame { width: 100%; max-width: 360px; }
  .hero-section h1 { font-size: 28px; }
  .hero-section p   { font-size: 15px; }
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .demo-nav .nav-links { display: none; }
  .page-container { padding: 0 14px; margin: 16px auto; }
}
