/* =============================================
   LakaConnect - Main Stylesheet
   Dark Navy + Glassmorphism Theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-deep: #0A1628;
  --bg-card: #0F2040;
  --bg-glass: rgba(15, 32, 64, 0.75);
  --accent-teal: #00D4C8;
  --accent-blue: #3B82F6;
  --accent-orange: #F59E0B;
  --accent-green: #10B981;
  --accent-red: #EF4444;
  --accent-purple: #8B5CF6;
  --text-primary: #E2E8F0;
  --text-muted: #64748B;
  --border: rgba(0, 212, 200, 0.15);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: 'Sarabun', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- Navbar ---- */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 22, 40, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.4rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-decoration: none;
}
.navbar-brand .logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; -webkit-text-fill-color: white;
}
.navbar-nav { display: flex; gap: 0.5rem; list-style: none; }
.navbar-nav a {
  color: var(--text-muted); text-decoration: none;
  padding: 6px 16px; border-radius: 8px;
  font-weight: 500; transition: all 0.2s;
}
.navbar-nav a:hover, .navbar-nav a.active {
  color: var(--accent-teal);
  background: rgba(0, 212, 200, 0.1);
}
.btn-admin {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  color: white !important; padding: 8px 20px !important;
  border-radius: 25px !important; font-weight: 600 !important;
  -webkit-text-fill-color: white !important;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 10px;
  font-size: 1rem; font-weight: 600; font-family: 'Sarabun', sans-serif;
  cursor: pointer; transition: all 0.25s; border: none; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  color: white;
  box-shadow: 0 4px 20px rgba(0, 212, 200, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0, 212, 200, 0.5); }
.btn-outline {
  background: transparent; color: var(--accent-teal);
  border: 2px solid var(--accent-teal);
}
.btn-outline:hover { background: rgba(0, 212, 200, 0.1); transform: translateY(-2px); }
.btn-success { background: linear-gradient(135deg, #10B981, #059669); color: white; }
.btn-warning { background: linear-gradient(135deg, #F59E0B, #D97706); color: white; }
.btn-danger  { background: linear-gradient(135deg, #EF4444, #DC2626); color: white; }
.btn-sm { padding: 6px 16px; font-size: 0.875rem; }
.btn-full { width: 100%; justify-content: center; }

/* ---- Cards ---- */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

/* ---- Stats ---- */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
  margin: 2rem 0;
}
.stat-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-4px); }
.stat-icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.stat-blue   .stat-icon { background: rgba(59,130,246,0.2); color: var(--accent-blue); }
.stat-orange .stat-icon { background: rgba(245,158,11,0.2); color: var(--accent-orange); }
.stat-teal   .stat-icon { background: rgba(0,212,200,0.2);  color: var(--accent-teal); }
.stat-green  .stat-icon { background: rgba(16,185,129,0.2); color: var(--accent-green); }
.stat-red    .stat-icon { background: rgba(239,68,68,0.2);  color: var(--accent-red); }
.stat-label  { font-size: 0.85rem; color: var(--text-muted); }
.stat-number { font-size: 2rem; font-weight: 800; line-height: 1.1; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 600;
}
.badge-pending    { background: rgba(245,158,11,0.15); color: var(--accent-orange); border: 1px solid rgba(245,158,11,0.3); }
.badge-in_progress{ background: rgba(0,212,200,0.15);  color: var(--accent-teal);   border: 1px solid rgba(0,212,200,0.3); }
.badge-resolved   { background: rgba(16,185,129,0.15); color: var(--accent-green);  border: 1px solid rgba(16,185,129,0.3); }
.badge-rejected   { background: rgba(239,68,68,0.15);  color: var(--accent-red);    border: 1px solid rgba(239,68,68,0.3); }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; margin-bottom: 6px; font-weight: 600; color: var(--text-primary); font-size: 0.95rem; }
.form-control {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; color: var(--text-primary);
  font-family: 'Sarabun', sans-serif; font-size: 1rem;
  transition: all 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(0, 212, 200, 0.15);
  background: rgba(0, 212, 200, 0.05);
}
.form-control option { background: var(--bg-card); }
textarea.form-control { resize: vertical; min-height: 120px; }

/* ---- Category Grid ---- */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.cat-item {
  padding: 14px 10px; border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 2px solid rgba(255,255,255,0.08);
  text-align: center; cursor: pointer; transition: all 0.2s;
}
.cat-item:hover { border-color: var(--accent-teal); background: rgba(0,212,200,0.08); }
.cat-item.selected { border-color: var(--accent-teal); background: rgba(0,212,200,0.15); }
.cat-item .cat-icon { font-size: 1.8rem; display: block; margin-bottom: 4px; }
.cat-item .cat-label { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Upload Zone ---- */
.upload-zone {
  border: 2px dashed rgba(0,212,200,0.3);
  border-radius: 12px; padding: 2rem;
  text-align: center; cursor: pointer; transition: all 0.2s;
}
.upload-zone:hover { border-color: var(--accent-teal); background: rgba(0,212,200,0.05); }
.upload-zone .upload-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.upload-preview { margin-top: 1rem; display: none; }
.upload-preview img { max-width: 100%; max-height: 200px; border-radius: 8px; }

/* ---- Timeline ---- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: 11px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-dot {
  position: absolute; left: -2rem; top: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; border: 2px solid;
}
.dot-pending    { background: rgba(245,158,11,0.2); border-color: var(--accent-orange); color: var(--accent-orange); }
.dot-in_progress{ background: rgba(0,212,200,0.2);  border-color: var(--accent-teal);   color: var(--accent-teal); }
.dot-resolved   { background: rgba(16,185,129,0.2); border-color: var(--accent-green);  color: var(--accent-green); }
.dot-rejected   { background: rgba(239,68,68,0.2);  border-color: var(--accent-red);    color: var(--accent-red); }
.timeline-content { background: var(--bg-glass); border: 1px solid var(--border); border-radius: 10px; padding: 1rem; }
.timeline-status { font-weight: 700; margin-bottom: 4px; }
.timeline-date   { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }
.timeline-remark { font-size: 0.9rem; color: var(--text-primary); }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: rgba(0,212,200,0.08);
  padding: 14px 16px; text-align: left;
  font-size: 0.85rem; color: var(--accent-teal); font-weight: 600;
  letter-spacing: 0.5px; border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.9rem; }
tbody tr:hover { background: rgba(0,212,200,0.04); }
tbody tr:last-child td { border-bottom: none; }

/* ---- Filter Tabs ---- */
.filter-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.filter-tab {
  padding: 8px 20px; border-radius: 25px; border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  font-family: 'Sarabun', sans-serif; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s;
}
.filter-tab:hover { border-color: var(--accent-teal); color: var(--accent-teal); }
.filter-tab.active {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  border-color: transparent; color: white;
}

/* ---- Hero ---- */
.hero {
  padding: 5rem 2rem;
  background: radial-gradient(ellipse at 20% 50%, rgba(0,212,200,0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 20%, rgba(59,130,246,0.08) 0%, transparent 50%);
  text-align: center;
}
.hero-badge {
  display: inline-block; margin-bottom: 1.5rem;
  padding: 6px 20px; border-radius: 25px;
  background: rgba(0,212,200,0.1); border: 1px solid rgba(0,212,200,0.3);
  color: var(--accent-teal); font-size: 0.9rem; font-weight: 600;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800; line-height: 1.2; margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff 30%, var(--accent-teal));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 540px; margin-inline: auto; }
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---- Container ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 3rem 0; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }
.section-title span {
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ---- Alert / Modal ---- */
.alert { padding: 1rem 1.25rem; border-radius: 10px; margin-bottom: 1.25rem; font-weight: 500; }
.alert-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: var(--accent-green); }
.alert-error   { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.3);  color: var(--accent-red); }
.alert-info    { background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: var(--accent-blue); }

.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 2.5rem; max-width: 480px; width: 90%; text-align: center; }
.modal-icon { font-size: 4rem; margin-bottom: 1rem; }
.tracking-code {
  font-size: 2rem; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin: 1rem 0;
}

/* ---- Admin Layout ---- */
.admin-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 260px; flex-shrink: 0;
  background: rgba(10,22,40,0.95);
  border-right: 1px solid var(--border);
  padding: 1.5rem; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.2rem; font-weight: 800; margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--accent-teal), var(--accent-blue));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-menu { list-style: none; flex: 1; }
.sidebar-menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 10px;
  color: var(--text-muted); text-decoration: none;
  font-weight: 500; transition: all 0.2s; margin-bottom: 4px;
}
.sidebar-menu a:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.sidebar-menu a.active { color: var(--accent-teal); background: rgba(0,212,200,0.1); }
.sidebar-footer { padding-top: 1rem; border-top: 1px solid var(--border); }
.admin-main { flex: 1; padding: 2rem; overflow-y: auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.admin-title { font-size: 1.75rem; font-weight: 800; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .hero { padding: 3rem 1rem; }
  .navbar { padding: 0 1rem; }
  .navbar-nav { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ---- Feed cards ---- */
.feed-card {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.feed-card:last-child { border-bottom: none; }
.feed-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  background: rgba(0,212,200,0.1);
}
.feed-title { font-weight: 600; margin-bottom: 4px; }
.feed-meta  { font-size: 0.82rem; color: var(--text-muted); }

/* ---- Track page ---- */
.track-box { max-width: 640px; margin: 0 auto; }
.track-search {
  display: flex; gap: 0.75rem;
  background: var(--bg-glass); border: 1px solid var(--border);
  border-radius: 14px; padding: 0.5rem;
}
.track-search input {
  flex: 1; background: none; border: none; color: var(--text-primary);
  font-family: 'Sarabun', sans-serif; font-size: 1rem; padding: 8px 12px;
}
.track-search input:focus { outline: none; }

/* ---- Loader ---- */
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(0,212,200,0.2);
  border-top-color: var(--accent-teal);
  animation: spin 0.8s linear infinite; margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
