/* InseeKarn Dark Comic Book Style! 🦇 */
:root {
  --bg: #0f0f0f;
  --bg-gradient: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 50%, #16213e 100%);
  --panel: #1e1e2e;
  --text: #ffffff;
  --muted: #cbd5e0;
  --primary: #ff6b6b;
  --secondary: #4ecdc4;
  --accent: #45b7d1;
  --success: #51cf66;
  --danger: #ff5722;
  --warning: #ffa726;
  --comic-blue: #00d4ff;
  --comic-red: #ff3366;
  --comic-yellow: #ffeb3b;
  --comic-green: #00ff88;
  --comic-purple: #9c27b0;
  --comic-pink: #ff4081;
  --shadow-color: #000;
  --outline-width: 3px;
  --bubble-bg: #2d2d44;
  --bubble-border: #f8fafc;
  
  /* Dark theme specific colors */
  --dark-surface: #252540;
  --dark-surface-variant: #2a2a42;
  --neon-glow: #ffffff;
  --cyber-accent: #ff0080;
  --electric-blue: #00bfff;
}

/* ============================================
   COMIC BOOK BASE STYLES
   ============================================ */
* { 
  box-sizing: border-box; 
}

html, body { 
  margin: 0; 
  padding: 0; 
  background: var(--bg-gradient);
  color: var(--text); 
  font-family: 'Comic Sans MS', 'Comic Neue', cursive, system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
header { 
  background: linear-gradient(135deg, var(--dark-surface) 0%, var(--dark-surface-variant) 100%);
  border-bottom: var(--outline-width) solid var(--neon-glow);
  box-shadow: 0 6px 0 var(--shadow-color), inset 0 1px 0 rgba(0, 255, 136, 0.3);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.1), transparent);
  animation: headerShine 3s ease-in-out infinite;
}

@keyframes headerShine {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: -100%; }
}

nav { 
  display: flex; 
  gap: 16px; 
  align-items: center; 
  padding: 16px 24px;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  text-shadow: 3px 3px 0 var(--shadow-color);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-right: auto;
}

nav a { 
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  text-shadow: 2px 2px 0 var(--shadow-color);
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

nav a:hover, 
nav a.active { 
  background: var(--neon-glow);
  color: var(--shadow-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 var(--shadow-color), 0 0 20px var(--neon-glow);
  text-shadow: 0 0 10px var(--shadow-color);
}

/* ============================================
   CONTAINER
   ============================================ */
.container { 
  max-width: 1200px; 
  margin: 24px auto; 
  padding: 0 20px;
}

/* ============================================
   AUTH PAGES (LOGIN, SIGNUP, FORGOT PASSWORD)
   ============================================ */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 100px);
  padding: 40px 20px;
}

.auth-card {
  background: linear-gradient(135deg, var(--panel), var(--dark-surface));
  border: 4px solid var(--neon-glow);
  border-radius: 30px;
  padding: 40px;
  max-width: 500px;
  width: 100%;
  box-shadow: 12px 12px 0 var(--shadow-color), 0 0 40px rgba(0, 255, 136, 0.2);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 30%, rgba(0, 255, 136, 0.05), transparent 60%);
  z-index: 0;
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-card h1 {
  font-size: 2.5rem;
  font-weight: 900;
  text-shadow: 4px 4px 0 var(--shadow-color);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 10px 0;
  text-align: center;
}

.auth-card p {
  text-align: center;
  color: var(--muted);
  margin-bottom: 30px;
  font-size: 1rem;
}

/* ============================================
   FORM STYLES
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.form-group input {
  background: var(--panel);
  border: 3px solid var(--shadow-color);
  color: var(--text);
  padding: 14px 18px;
  border-radius: 15px;
  width: 100%;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}

.form-group input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.3), inset 2px 2px 4px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.error-message {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 5px;
  font-weight: 700;
  display: none;
}

.error-message.show {
  display: block;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  background: var(--primary);
  color: white;
  border: 3px solid var(--shadow-color);
  padding: 14px 28px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 var(--shadow-color);
  box-shadow: 6px 6px 0 var(--shadow-color);
  transition: all 0.2s ease;
  width: 100%;
  margin-bottom: 15px;
  font-family: inherit;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 9px 9px 0 var(--shadow-color);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 3px 3px 0 var(--shadow-color);
}

.btn-google {
  background: white;
  color: #333;
  border-color: #ddd;
  box-shadow: 6px 6px 0 #ddd;
  text-shadow: none;
}

.btn-google:hover {
  box-shadow: 9px 9px 0 #ddd;
}

.btn-google:active {
  box-shadow: 3px 3px 0 #ddd;
}

.btn-github {
  background: #24292e;
  color: white;
  border-color: var(--shadow-color);
}

.divider {
  text-align: center;
  margin: 25px 0;
  position: relative;
}

.divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 40%;
  height: 2px;
  background: var(--muted);
}

.divider::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  width: 40%;
  height: 2px;
  background: var(--muted);
}

.divider span {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  background: var(--panel);
  padding: 0 10px;
}

.link-text {
  text-align: center;
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.95rem;
}

.link-text a {
  color: var(--electric-blue);
  text-decoration: none;
  font-weight: 700;
  transition: color 0.2s ease;
}

.link-text a:hover {
  text-decoration: underline;
  color: var(--comic-blue);
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */
.dashboard-header {
  background: linear-gradient(135deg, var(--dark-surface), var(--dark-surface-variant));
  border: 4px solid var(--neon-glow);
  border-radius: 25px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 8px 8px 0 var(--shadow-color);
}

.dashboard-header h1 {
  font-size: 2.5rem;
  font-weight: 900;
  text-shadow: 4px 4px 0 var(--shadow-color);
  color: var(--primary);
  text-transform: uppercase;
  margin: 0 0 10px 0;
}

.dashboard-header p {
  color: var(--muted);
  margin: 0;
  font-size: 1.1rem;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, var(--panel), var(--dark-surface));
  border: 4px solid var(--shadow-color);
  border-radius: 20px;
  padding: 25px;
  box-shadow: 6px 6px 0 var(--shadow-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 70% 30%, rgba(255,255,255,0.05), transparent 50%);
  z-index: 0;
}

.stat-card > * {
  position: relative;
  z-index: 1;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 10px 10px 0 var(--shadow-color), 0 0 30px rgba(0, 255, 136, 0.2);
}

.stat-card.income {
  border-color: var(--success);
}

.stat-card.expense {
  border-color: var(--danger);
}

.stat-card.users {
  border-color: var(--electric-blue);
}

.stat-card.pending {
  border-color: var(--warning);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text);
  text-shadow: 2px 2px 0 rgba(255,255,255,0.1);
}

.stat-change {
  font-size: 0.85rem;
  margin-top: 8px;
  font-weight: 700;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--danger);
}

/* ============================================
   CHART SECTION
   ============================================ */
.chart-section {
  background: linear-gradient(135deg, var(--panel), var(--dark-surface));
  border: 4px solid var(--neon-glow);
  border-radius: 25px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 8px 8px 0 var(--shadow-color);
}

.chart-section h2 {
  font-size: 1.8rem;
  font-weight: 900;
  text-shadow: 3px 3px 0 var(--shadow-color);
  color: var(--primary);
  text-transform: uppercase;
  margin: 0 0 20px 0;
}

.chart-container {
  position: relative;
  height: 300px;
  background: var(--bg);
  border: 3px solid var(--shadow-color);
  border-radius: 15px;
  padding: 20px;
}

/* ============================================
   TABLE SECTION
   ============================================ */
.table-section {
  background: linear-gradient(135deg, var(--panel), var(--dark-surface));
  border: 4px solid var(--neon-glow);
  border-radius: 25px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 8px 8px 0 var(--shadow-color);
}

.table-section h2 {
  font-size: 1.8rem;
  font-weight: 900;
  text-shadow: 3px 3px 0 var(--shadow-color);
  color: var(--primary);
  text-transform: uppercase;
  margin: 0 0 20px 0;
}

.table-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.table-controls input,
.table-controls select {
  background: var(--panel);
  border: 3px solid var(--shadow-color);
  color: var(--text);
  padding: 10px 15px;
  border-radius: 15px;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
}

.table-controls input {
  flex: 1;
  min-width: 200px;
}

.table-controls input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

.table-controls select {
  min-width: 150px;
  cursor: pointer;
}

.table-controls button {
  background: var(--secondary);
  color: white;
  border: 3px solid var(--shadow-color);
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 4px 4px 0 var(--shadow-color);
  transition: all 0.2s ease;
  font-family: inherit;
  letter-spacing: 0.5px;
}

.table-controls button:hover {
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 var(--shadow-color);
}

.table-controls button:active {
  transform: translateY(0);
  box-shadow: 2px 2px 0 var(--shadow-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 3px solid var(--shadow-color);
  border-radius: 15px;
  overflow: hidden;
}

.data-table thead {
  background: var(--dark-surface);
}

.data-table th {
  padding: 15px;
  text-align: left;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--text);
  border-bottom: 3px solid var(--shadow-color);
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
}

.data-table th:hover {
  background: rgba(255,255,255,0.05);
}

.data-table tbody tr {
  border-bottom: 2px solid var(--shadow-color);
  transition: all 0.2s ease;
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
  transform: scale(1.01);
}

.data-table td {
  padding: 15px;
  color: var(--text);
}

.status-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid var(--shadow-color);
}

.status-badge.completed {
  background: var(--success);
  color: white;
}

.status-badge.pending {
  background: var(--warning);
  color: var(--shadow-color);
}

.status-badge.failed {
  background: var(--danger);
  color: white;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .logo {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
    margin-right: 0;
  }
  
  .auth-container {
    padding: 20px 15px;
  }
  
  .auth-card {
    padding: 30px 20px;
  }
  
  .auth-card h1 {
    font-size: 2rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .table-controls {
    flex-direction: column;
  }
  
  .table-controls input {
    min-width: 100%;
  }
  
  .table-controls select {
    width: 100%;
  }
  
  .data-table {
    font-size: 0.85rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 10px 8px;
  }
  
  .chart-container {
    height: 250px;
  }
}

@media (max-width: 480px) {
  .auth-card h1 {
    font-size: 1.75rem;
  }
  
  .dashboard-header h1 {
    font-size: 2rem;
  }
  
  .stat-value {
    font-size: 2rem;
  }
  
  .data-table {
    font-size: 0.75rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 8px 5px;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}