/* Theme CSS - CSS Custom Properties and Utility Classes */
/* Matches src/index.css color tokens exactly */

:root {
  --background: oklch(0.15 0.02 270);
  --foreground: oklch(0.95 0 0);
  --card: oklch(0.20 0.02 260);
  --card-foreground: oklch(0.95 0 0);
  --popover: oklch(0.20 0.02 260);
  --popover-foreground: oklch(0.95 0 0);
  --primary: oklch(0.45 0.15 290);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.25 0.02 260);
  --secondary-foreground: oklch(0.95 0 0);
  --muted: oklch(0.30 0.02 270);
  --muted-foreground: oklch(0.60 0.01 270);
  --accent: oklch(0.75 0.15 195);
  --accent-foreground: oklch(0.15 0 0);
  --destructive: oklch(0.55 0.22 25);
  --destructive-foreground: oklch(1 0 0);
  --border: oklch(0.30 0.03 270);
  --input: oklch(0.30 0.03 270);
  --ring: oklch(0.75 0.15 195);
  --radius: 0.5rem;
  --success: oklch(0.65 0.18 145);
  --success-foreground: oklch(0.15 0 0);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--background);
  color: var(--foreground);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Orbitron', sans-serif;
}

* {
  border-color: var(--border);
}

/* Utility classes */
.bg-background { background-color: var(--background); }
.text-foreground { color: var(--foreground); }
.bg-card { background-color: var(--card); }
.text-card-foreground { color: var(--card-foreground); }
.bg-primary { background-color: var(--primary); }
.text-primary { color: var(--primary); }
.text-primary-foreground { color: var(--primary-foreground); }
.bg-secondary { background-color: var(--secondary); }
.text-secondary-foreground { color: var(--secondary-foreground); }
.bg-muted { background-color: var(--muted); }
.text-muted-foreground { color: var(--muted-foreground); }
.bg-accent { background-color: var(--accent); }
.text-accent { color: var(--accent); }
.text-accent-foreground { color: var(--accent-foreground); }
.bg-destructive { background-color: var(--destructive); }
.text-destructive { color: var(--destructive); }
.text-destructive-foreground { color: var(--destructive-foreground); }
.border-border { border-color: var(--border); }
.text-success { color: var(--success); }
.bg-success { background-color: var(--success); }

/* Special effects */
.hero-gradient {
  background: linear-gradient(135deg, oklch(0.20 0.08 290) 0%, oklch(0.15 0.02 270) 50%, oklch(0.18 0.05 250) 100%);
}

.glow-accent {
  box-shadow: 0 0 20px oklch(0.75 0.15 195 / 0.3);
}

.glow-primary {
  box-shadow: 0 0 20px oklch(0.45 0.15 290 / 0.4);
}

.grid-pattern {
  background-image: 
    linear-gradient(oklch(0.30 0.05 270 / 0.3) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.30 0.05 270 / 0.3) 1px, transparent 1px);
  background-size: 30px 30px;
}

/* Animation utilities */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Generic scroll-reveal — used by home page sections */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Toast/Flash messages */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  animation: slideInRight 0.3s ease;
  max-width: 400px;
}

.toast.success {
  border-left: 4px solid var(--success);
}

.toast.error {
  border-left: 4px solid var(--destructive);
}

.toast.info {
  border-left: 4px solid var(--accent);
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--card);
  border-left: 1px solid var(--border);
  transition: right 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

.mobile-drawer.open {
  right: 0;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* Tab system */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Button variants matching Shadcn UI */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: oklch(0.50 0.15 290);
}

.btn-accent {
  background: var(--accent);
  color: var(--accent-foreground);
}

.btn-accent:hover {
  background: oklch(0.80 0.15 195);
}

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

.btn-outline:hover {
  background: var(--muted);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background: var(--muted);
}

/* Form elements */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--foreground);
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px oklch(0.75 0.15 195 / 0.2);
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--foreground);
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: calc(var(--radius) * 0.75);
  border: 1px solid transparent;
}

.badge-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.badge-accent {
  background: var(--accent);
  color: var(--accent-foreground);
}

.badge-destructive {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.badge-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}

/* ---- Form controls ---- */
.label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}
.input {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
  background: oklch(0.18 0.02 270);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px oklch(0.75 0.15 195 / 0.2);
}
textarea.input { resize: vertical; min-height: 84px; }
select.input { cursor: pointer; }

/* ---- Smaller button variant ---- */
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; gap: 0.25rem; border-radius: 0.375rem; }

/* ---- Line clamp ---- */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
