:root {
  /* Colors */
  --bg-body: #09090b;
  --bg-card: #18181b;
  --bg-elevated: #27272a;
  --bg-input: #27272a;
  
  --text-main: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-orange: #f97316;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  
  --border: #3f3f46;
  --border-focus: #8b5cf6;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; line-height: 1.1; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-green); }
.text-warning { color: var(--accent-orange); }
.text-danger { color: var(--accent-red); }
.font-bold { font-weight: 600; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.w-full { width: 100%; }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  width: 100%;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md) 0;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

/* Components */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: #52525b;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-elevated);
  border-color: var(--text-muted);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.input-group {
  margin-bottom: var(--space-md);
}

.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.form-input, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-main);
  font-family: inherit;
  transition: all 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Custom Checkbox/Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: .4s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary);
  border-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

/* Range Slider */
.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 5px;
  background: var(--bg-elevated);
  outline: none;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--bg-card);
}

/* Stats */
.stat-card {
  display: flex;
  flex-direction: column;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
}
.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: var(--space-md);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge-warning { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.badge-neutral { background: var(--bg-elevated); color: var(--text-muted); }

/* Charts */
.chart-container {
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.bar {
  width: 100%;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  opacity: 0.7;
  transition: opacity 0.2s, height 0.5s ease-out;
  position: relative;
}
.bar:hover { opacity: 1; }
.bar-label {
    position: absolute;
    bottom: -25px;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Tables */
.table-container {
    overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
}
.table tr:last-child td { border-bottom: none; }

/* Prediction Badge */
.prediction-result {
    text-align: center;
    padding: var(--space-xl);
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}
.pred-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    font-size: 2.5rem;
    border: 2px solid rgba(239, 68, 68, 0.3);
}

.hero-section {
    padding: 80px 0;
    text-align: center;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-elevated);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

/* Loading/Progress */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-elevated);
    border-radius: 4px;
    overflow: hidden;
}
.progress-value {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
}

/* Auth Page Specific */
.auth-layout {
    display: flex;
    min-height: 100vh;
}
.auth-sidebar {
    width: 40%;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-image {
    width: 60%;
    background: radial-gradient(circle at center, #2e1065 0%, #09090b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 768px) {
    .auth-sidebar { width: 100%; }
    .auth-image { display: none; }
}

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

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

