@tailwind base;
@tailwind components;
@tailwind utilities;

/* ============================================
   DESIGN SYSTEM — Drive
   Premium dark/light theme with CSS variables
   ============================================ */

:root {
  /* Dark theme (default) */
  --color-bg-primary: #0a0a0f;
  --color-bg-secondary: #12121a;
  --color-bg-tertiary: #1a1a26;
  --color-bg-elevated: #1e1e2e;
  --color-bg-hover: #252536;
  --color-bg-active: #2d2d42;
  --color-bg-glass: rgba(30, 30, 46, 0.7);

  --color-border: #2a2a3d;
  --color-border-subtle: #1f1f30;
  --color-border-focus: #6366f1;

  --color-text-primary: #e8e8ed;
  --color-text-secondary: #9ca3af;
  --color-text-tertiary: #6b7280;
  --color-text-inverse: #0a0a0f;

  --color-accent: #6366f1;
  --color-accent-hover: #7c7ff7;
  --color-accent-subtle: rgba(99, 102, 241, 0.15);

  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --color-info: #3b82f6;

  --color-sidebar-bg: #0d0d14;
  --color-sidebar-hover: #1a1a28;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
[data-theme="light"] {
  --color-bg-primary: #fafafa;
  --color-bg-secondary: #ffffff;
  --color-bg-tertiary: #f5f5f5;
  --color-bg-elevated: #ffffff;
  --color-bg-hover: #f0f0f5;
  --color-bg-active: #e8e8f0;
  --color-bg-glass: rgba(255, 255, 255, 0.8);

  --color-border: #e2e2ea;
  --color-border-subtle: #ececf0;
  --color-border-focus: #6366f1;

  --color-text-primary: #111118;
  --color-text-secondary: #4b5563;
  --color-text-tertiary: #9ca3af;
  --color-text-inverse: #ffffff;

  --color-sidebar-bg: #f0f0f5;
  --color-sidebar-hover: #e4e4ec;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.1);
}

/* ============================================
   BASE STYLES
   ============================================ */

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

html {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  min-height: 100vh;
  overflow: hidden;
}

/* Smooth transitions for theme switching */
body,
body * {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-tertiary);
}

/* ============================================
   SELECTION HIGHLIGHT
   ============================================ */

::selection {
  background-color: var(--color-accent-subtle);
  color: var(--color-accent);
}

/* ============================================
   FOCUS STYLES
   ============================================ */

:focus-visible {
  outline: 2px solid var(--color-border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */

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

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--shadow-glow); }
  50% { box-shadow: 0 0 30px rgba(99, 102, 241, 0.3); }
}

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

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

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