/* ============================================================
   SpyMe - Consent-Based Device Tracking
   style.css — Main Stylesheet
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:       #1a73e8;
  --primary-dark:  #1558b0;
  --accent:        #34a853;
  --danger:        #ea4335;
  --warning:       #fbbc04;
  --bg:            #f8f9fa;
  --surface:       #ffffff;
  --surface-2:     #f1f3f4;
  --text:          #202124;
  --text-muted:    #5f6368;
  --border:        #dadce0;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md:     0 4px 12px rgba(0,0,0,.12);
  --shadow-lg:     0 8px 28px rgba(0,0,0,.16);
  --radius:        12px;
  --radius-sm:     8px;
  --transition:    .2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ---------- Utility ---------- */
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .4px;
}
.badge-green  { background: #e6f4ea; color: #1e7e34; }
.badge-blue   { background: #e8f0fe; color: #1a73e8; }
.badge-red    { background: #fce8e6; color: #c5221f; }
.badge-yellow { background: #fef7e0; color: #b06000; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-success {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-success:hover { background: #2d8f47; text-decoration: none; }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #c5221f; text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: #e8f0fe; text-decoration: none; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; border-radius: var(--radius); }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Navbar ---------- */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.navbar-brand span { color: var(--text); }
.navbar-brand:hover { text-decoration: none; }
.logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.1rem;
}
.navbar-links { display: flex; gap: 24px; align-items: center; }
.navbar-links a { color: var(--text-muted); font-size: .9rem; font-weight: 500; }
.navbar-links a:hover { color: var(--primary); text-decoration: none; }

/* ---------- Hero Section ---------- */
.hero {
  background: linear-gradient(135deg, #1a73e8 0%, #1558b0 100%);
  color: #fff;
  padding: 64px 20px;
  text-align: center;
}
.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
}
.hero h1 span { color: #fbbc04; }
.hero p {
  font-size: 1.15rem;
  opacity: .9;
  max-width: 560px;
  margin: 0 auto 28px;
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: .82rem;
  margin-bottom: 20px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 24px;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 1rem; font-weight: 600; }
.icon-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ic-blue   { background: #e8f0fe; color: #1a73e8; }
.ic-green  { background: #e6f4ea; color: #34a853; }
.ic-red    { background: #fce8e6; color: #ea4335; }
.ic-yellow { background: #fef7e0; color: #b06000; }

/* ---------- Features Grid ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  padding: 48px 0;
}
.feature-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-icon { font-size: 2.2rem; margin-bottom: 14px; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: .9rem; color: var(--text-muted); line-height: 1.55; }

/* ---------- Consent Banner ---------- */
.consent-banner {
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 32px;
  margin: 40px auto;
  max-width: 680px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.consent-banner h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 10px; color: var(--primary); }
.consent-banner p { font-size: .92rem; color: var(--text-muted); margin-bottom: 16px; }
.consent-list { list-style: none; margin-bottom: 20px; }
.consent-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .9rem;
  margin-bottom: 10px;
  color: var(--text);
}
.consent-list li::before {
  content: "✅";
  flex-shrink: 0;
  margin-top: 1px;
}
.consent-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.consent-note {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ---------- Status Panel ---------- */
.status-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  margin: 32px auto;
  max-width: 680px;
}
.status-panel-header {
  background: var(--surface-2);
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: .95rem;
}
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.status-row:last-child { border-bottom: none; }
.status-row label { color: var(--text-muted); font-weight: 500; }
.status-value { font-weight: 600; font-family: 'Courier New', monospace; font-size: .85rem; }
.pulse {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s infinite;
  margin-right: 6px;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.3); }
}

/* ---------- Toast Notifications ---------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast {
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 360px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: slideIn .25s ease;
  font-size: .9rem;
}
.toast.success { border-color: var(--accent); }
.toast.error   { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-body strong { display: block; font-weight: 600; margin-bottom: 2px; }
.toast-body span { color: var(--text-muted); font-size: .82rem; }
@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ---------- Modal Overlay ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  animation: slideUp .25s ease;
}
.modal h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 10px; }
.modal p { color: var(--text-muted); font-size: .92rem; margin-bottom: 20px; }
.modal-icon { font-size: 3rem; margin-bottom: 14px; }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- Dashboard Styles ---------- */
.dash-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 60px);
}
.dash-sidebar {
  background: var(--text);
  color: #fff;
  padding: 24px 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.dash-sidebar .sidebar-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  padding: 0 20px 10px;
}
.dash-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border-left: 3px solid transparent;
}
.dash-sidebar a:hover,
.dash-sidebar a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
  border-left-color: var(--primary);
}
.dash-main { padding: 28px; overflow-x: hidden; }
.dash-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.dash-topbar h1 { font-size: 1.4rem; font-weight: 700; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; margin: 6px 0 4px; }
.stat-card .stat-sub { font-size: .8rem; color: var(--text-muted); }

#map {
  width: 100%;
  height: 440px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-top: 28px;
}
.table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.table-header h3 { font-size: 1rem; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead th {
  background: var(--surface-2);
  padding: 11px 16px;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
tbody tr:hover { background: var(--surface-2); }
tbody td { padding: 11px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
tbody tr:last-child td { border-bottom: none; }
.td-mono { font-family: monospace; font-size: .82rem; color: var(--text-muted); }

/* ---------- Login Page ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a73e8 0%, #1558b0 100%);
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}
.login-card h1 { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.login-card p  { color: var(--text-muted); font-size: .9rem; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  outline: none;
  transition: border-color var(--transition);
  background: var(--surface);
  color: var(--text);
}
.form-control:focus { border-color: var(--primary); }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- Footer ---------- */
.footer {
  background: var(--text);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 28px 20px;
  font-size: .85rem;
  margin-top: 60px;
}
.footer a { color: rgba(255,255,255,.9); }
.footer strong { color: #fff; }

/* ---------- Section Headings ---------- */
.section { padding: 48px 0; }
.section-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.section-sub { color: var(--text-muted); font-size: 1rem; max-width: 540px; }

/* ---------- Divider ---------- */
.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ---------- Privacy Policy Page ---------- */
.prose { max-width: 720px; margin: 0 auto; padding: 40px 20px; }
.prose h1 { font-size: 1.8rem; font-weight: 800; margin-bottom: 6px; }
.prose h2 { font-size: 1.15rem; font-weight: 700; margin: 28px 0 10px; color: var(--primary); }
.prose p  { font-size: .95rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 14px; }
.prose ul { padding-left: 20px; margin-bottom: 14px; }
.prose ul li { font-size: .95rem; color: var(--text-muted); margin-bottom: 6px; line-height: 1.7; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .navbar-links { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .consent-actions { flex-direction: column; }
}