/**
 * AISA Admin Dashboard - Theme System
 * Based on thirdweb playground design
 */

:root {
  /* Color System (HSL) */
  --background: 0 0% 98%;
  --foreground: 0 0% 4%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 4%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 4%;
  --primary: 221 83% 54%;
  --primary-foreground: 0 0% 100%;
  --secondary: 0 0% 90%;
  --secondary-foreground: 0 0% 4%;
  --muted: 0 0% 93%;
  --muted-foreground: 0 0% 40%;
  --accent: 0 0% 93%;
  --accent-foreground: 0 0% 4%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 100%;
  --border: 0 0% 85%;
  --input: 0 0% 85%;
  --ring: 221 83% 54%;

  /* Sidebar Colors */
  --sidebar-background: 0 0% 98%;
  --sidebar-foreground: 0 0% 4%;
  --sidebar-primary: 221 83% 54%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 0 0% 93%;
  --sidebar-accent-foreground: 0 0% 4%;
  --sidebar-border: 0 0% 85%;

  /* Dimensions */
  --sidebar-width: 280px;
  --sidebar-width-icon: 48px;
  --radius: 0.5rem;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Monaco', 'Courier New', monospace;
}

.dark {
  --background: 0 0% 0%;
  --foreground: 0 0% 98%;
  --card: 0 0% 3.92%;
  --card-foreground: 0 0% 98%;
  --popover: 0 0% 3.92%;
  --popover-foreground: 0 0% 98%;
  --primary: 221 83% 54%;
  --primary-foreground: 0 0% 100%;
  --secondary: 0 0% 11%;
  --secondary-foreground: 0 0% 98%;
  --muted: 0 0% 11%;
  --muted-foreground: 0 0% 60%;
  --accent: 0 0% 11%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 100%;
  --border: 0 0% 15%;
  --input: 0 0% 15%;
  --ring: 221 83% 54%;

  --sidebar-background: 0 0% 0%;
  --sidebar-foreground: 0 0% 98%;
  --sidebar-primary: 221 83% 54%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 0 0% 11%;
  --sidebar-accent-foreground: 0 0% 98%;
  --sidebar-border: 0 0% 15%;
}

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

body {
  font-family: var(--font-sans);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground));
}

/* Utility Classes */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Card Component */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Button Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: calc(var(--radius) - 2px);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.btn:focus-visible {
  ring: 2px;
  ring-color: hsl(var(--ring));
  ring-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

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

.btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
}

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

.btn-secondary:hover {
  background: hsl(var(--secondary) / 0.8);
}

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

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

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

.btn-destructive:hover {
  background: hsl(var(--destructive) / 0.9);
}

/* Input Components */
.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  outline: none;
  transition: all 0.2s ease;
}

.input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Badge Component */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-default {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.badge-success {
  background: hsl(142 76% 36%);
  color: white;
}

.badge-warning {
  background: hsl(38 92% 50%);
  color: white;
}

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

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-slide-in {
  animation: slideIn 0.3s ease;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease;
}

.animate-spin {
  animation: spin 0.8s linear infinite;
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid hsl(var(--muted));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
}
