/* =====================================================
   SECURITAS ACADEMY - Global Styles
   Professional Police & Security Training Platform
   ===================================================== */

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

:root {
  /* Color Palette */
  --navy-900: #040d1a;
  --navy-800: #071428;
  --navy-700: #0a1f3d;
  --navy-600: #0d2a52;
  --navy-500: #103567;
  --blue-500: #1a56db;
  --blue-400: #1e6ef5;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;
  --cyan-300: #67e8f9;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --white: #ffffff;

  /* Semantic Colors */
  --primary: #1a56db;
  --primary-light: #3b82f6;
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #6366f1;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #040d1a 0%, #071428 50%, #0a1f3d 100%);
  --gradient-accent: linear-gradient(135deg, #1a56db 0%, #06b6d4 100%);
  --gradient-card: linear-gradient(135deg, rgba(26,86,219,0.15) 0%, rgba(6,182,212,0.05) 100%);
  --gradient-glow: linear-gradient(135deg, #1a56db22, #06b6d422);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(6,182,212,0.3);
  --shadow-blue: 0 0 30px rgba(26,86,219,0.4);

  /* Typography */
  --font-main: 'Inter', sans-serif;
  --font-display: 'Rajdhani', sans-serif;

  /* Spacing */
  --sidebar-width: 260px;
  --header-height: 64px;
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--navy-900);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--navy-800); }
::-webkit-scrollbar-thumb { background: var(--navy-500); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-500); }

/* ===================== NAVIGATION ===================== */
.nav-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--navy-800);
  border-right: 1px solid rgba(26,86,219,0.2);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: var(--transition);
}

.nav-logo {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
}

.nav-logo-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 1px;
  line-height: 1.1;
}

.nav-logo-subtitle {
  font-size: 10px;
  color: var(--cyan-400);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
}

.nav-section {
  padding: 20px 16px 8px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--gray-400);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: rgba(26,86,219,0.15);
  color: var(--white);
}

.nav-item.active {
  background: rgba(26,86,219,0.25);
  color: var(--cyan-400);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--gradient-accent);
  border-radius: 0 2px 2px 0;
}

.nav-item-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--blue-500);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.nav-badge.cyan { background: var(--cyan-500); }
.nav-badge.success { background: var(--success); }

.nav-user {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  border: 2px solid rgba(6,182,212,0.4);
}

.nav-user-info { flex: 1; min-width: 0; }
.nav-user-name { font-size: 13px; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user-rank { font-size: 11px; color: var(--cyan-400); font-weight: 500; }

/* ===================== MAIN LAYOUT ===================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  height: var(--header-height);
  background: rgba(7,20,40,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(26,86,219,0.15);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-bar-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--white);
}

.top-bar-breadcrumb {
  font-size: 13px;
  color: var(--gray-500);
}

.top-bar-spacer { flex: 1; }

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
  text-decoration: none;
  position: relative;
}

.icon-btn:hover { background: rgba(26,86,219,0.2); color: var(--white); border-color: rgba(26,86,219,0.4); }

.icon-btn .notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--cyan-400);
  border-radius: 50%;
  border: 1px solid var(--navy-800);
}

.page-content {
  flex: 1;
  padding: 28px 28px;
  overflow-y: auto;
}

/* ===================== CARDS ===================== */
.card {
  background: var(--navy-800);
  border: 1px solid rgba(26,86,219,0.15);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(6,182,212,0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.card-body { padding: 20px 24px; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  font-family: var(--font-main);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: 0 4px 15px rgba(26,86,219,0.4);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,86,219,0.5); }

.btn-secondary {
  background: rgba(255,255,255,0.07);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-secondary:hover { background: rgba(255,255,255,0.12); }

.btn-ghost {
  background: transparent;
  color: var(--cyan-400);
  padding: 6px 12px;
  font-size: 13px;
}
.btn-ghost:hover { background: rgba(6,182,212,0.1); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 10px; }
.btn-icon-only { padding: 8px; border-radius: 8px; }

/* ===================== BADGES & TAGS ===================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.badge-blue { background: rgba(26,86,219,0.2); color: #60a5fa; border: 1px solid rgba(26,86,219,0.3); }
.badge-cyan { background: rgba(6,182,212,0.15); color: var(--cyan-300); border: 1px solid rgba(6,182,212,0.3); }
.badge-success { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.badge-warning { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.badge-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-purple { background: rgba(99,102,241,0.15); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.3); }

/* ===================== PROGRESS BARS ===================== */
.progress-track {
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-accent);
  border-radius: 3px;
  transition: width 0.6s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-400);
  box-shadow: 0 0 6px var(--cyan-400);
}

.progress-fill.success { background: linear-gradient(90deg, var(--success), #34d399); }
.progress-fill.warning { background: linear-gradient(90deg, var(--warning), #fbbf24); }

/* ===================== GLOW EFFECTS ===================== */
.glow-cyan { box-shadow: 0 0 20px rgba(6,182,212,0.3); }
.glow-blue { box-shadow: 0 0 20px rgba(26,86,219,0.4); }

.ai-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cyan-400);
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.25);
  padding: 3px 8px;
  border-radius: 20px;
}

.ai-dot {
  width: 6px;
  height: 6px;
  background: var(--cyan-400);
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.ai-badge-active {
  background: linear-gradient(90deg, rgba(6,182,212,0.15), rgba(26,86,219,0.15));
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--cyan-300);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===================== GRID SYSTEM ===================== */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ===================== STAT CARDS ===================== */
.stat-card {
  background: var(--navy-800);
  border: 1px solid rgba(26,86,219,0.15);
  border-radius: var(--border-radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: var(--transition);
}

.stat-card:hover { border-color: rgba(6,182,212,0.3); transform: translateY(-2px); }
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.blue { background: rgba(26,86,219,0.2); color: #60a5fa; }
.stat-icon.cyan { background: rgba(6,182,212,0.15); color: var(--cyan-400); }
.stat-icon.success { background: rgba(16,185,129,0.15); color: #34d399; }
.stat-icon.warning { background: rgba(245,158,11,0.15); color: #fbbf24; }
.stat-icon.purple { background: rgba(99,102,241,0.15); color: #a5b4fc; }

.stat-content { flex: 1; min-width: 0; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--white); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-top: 4px; font-weight: 500; }
.stat-change { font-size: 12px; font-weight: 600; margin-top: 6px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ===================== TABLES ===================== */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.data-table td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--gray-300);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* ===================== TABS ===================== */
.tab-nav {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--gray-400);
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-main);
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--white); }
.tab-btn.active { background: var(--navy-700); color: var(--cyan-400); box-shadow: var(--shadow-sm); }

/* ===================== INPUTS ===================== */
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--white);
  font-size: 14px;
  font-family: var(--font-main);
  transition: var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--blue-400);
  background: rgba(26,86,219,0.08);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}

.form-input::placeholder { color: var(--gray-600); }

/* ===================== UTILITY ===================== */
.text-white { color: var(--white); }
.text-gray { color: var(--gray-400); }
.text-cyan { color: var(--cyan-400); }
.text-blue { color: #60a5fa; }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.opacity-70 { opacity: 0.7; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* ===================== DIVIDER ===================== */
.divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 20px 0;
}

/* ===================== PAGE NAV TABS ===================== */
.page-nav {
  display: flex;
  gap: 4px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: var(--navy-800);
  position: sticky;
  top: var(--header-height);
  z-index: 40;
}

.page-nav-item {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
}

.page-nav-item:hover { color: var(--white); }
.page-nav-item.active { color: var(--cyan-400); border-bottom-color: var(--cyan-400); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-sidebar { transform: translateX(-100%); }
  .nav-sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
}

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade { animation: fadeIn 0.4s ease forwards; }

.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

/* ===================== SECTION HEADERS ===================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(26,86,219,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--cyan-400);
}
