@import "tailwindcss";
@import "tw-animate-css";

@custom-variant dark (&:is(.dark *));

/* 
 * ATLAS Social Command Center — Design System
 * Bloomberg Terminal × Raumschiff-Brücke × Creator Studio
 * 
 * Signature Color: #00d4ff (ATLAS Cyan)
 * Background: #0a0e1a (Deep Space Navy)
 * Typography: Space Grotesk (headings) / Inter (body) / Space Mono (metrics)
 */

@theme inline {
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
  
  /* ATLAS Custom Tokens */
  --color-atlas-cyan: var(--atlas-cyan);
  --color-atlas-cyan-glow: var(--atlas-cyan-glow);
  --color-atlas-navy: var(--atlas-navy);
  --color-atlas-surface: var(--atlas-surface);
  --color-atlas-border: var(--atlas-border);
  --color-atlas-amber: var(--atlas-amber);
  --color-atlas-green: var(--atlas-green);
  --color-atlas-red: var(--atlas-red);
  
  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

/* ATLAS Dark Theme — Only Mode */
:root, .dark {
  /* Core ATLAS Colors */
  --atlas-cyan: oklch(0.82 0.18 210);       /* #00d4ff */
  --atlas-cyan-glow: oklch(0.82 0.18 210 / 0.15);
  --atlas-navy: oklch(0.12 0.03 265);       /* #0a0e1a */
  --atlas-surface: oklch(0.15 0.03 265);    /* #0f1629 */
  --atlas-border: oklch(0.22 0.05 265);     /* #1e2d4a */
  --atlas-amber: oklch(0.75 0.15 75);       /* #f59e0b */
  --atlas-green: oklch(0.65 0.15 165);      /* #10b981 */
  --atlas-red: oklch(0.62 0.22 25);         /* #ef4444 */
  
  /* Semantic Tokens — Dark Mode Only */
  --radius: 0.375rem;
  --background: oklch(0.12 0.03 265);
  --foreground: oklch(0.88 0.01 220);
  --card: oklch(0.15 0.03 265);
  --card-foreground: oklch(0.88 0.01 220);
  --popover: oklch(0.17 0.04 265);
  --popover-foreground: oklch(0.88 0.01 220);
  --primary: oklch(0.82 0.18 210);
  --primary-foreground: oklch(0.12 0.03 265);
  --secondary: oklch(0.20 0.04 265);
  --secondary-foreground: oklch(0.75 0.01 220);
  --muted: oklch(0.20 0.04 265);
  --muted-foreground: oklch(0.52 0.02 220);
  --accent: oklch(0.22 0.05 265);
  --accent-foreground: oklch(0.88 0.01 220);
  --destructive: oklch(0.62 0.22 25);
  --destructive-foreground: oklch(0.98 0 0);
  --border: oklch(0.22 0.05 265);
  --input: oklch(0.20 0.04 265);
  --ring: oklch(0.82 0.18 210);
  
  /* Charts */
  --chart-1: oklch(0.82 0.18 210);
  --chart-2: oklch(0.75 0.15 75);
  --chart-3: oklch(0.65 0.15 165);
  --chart-4: oklch(0.62 0.22 25);
  --chart-5: oklch(0.70 0.12 300);
  
  /* Sidebar */
  --sidebar: oklch(0.13 0.03 265);
  --sidebar-foreground: oklch(0.88 0.01 220);
  --sidebar-primary: oklch(0.82 0.18 210);
  --sidebar-primary-foreground: oklch(0.12 0.03 265);
  --sidebar-accent: oklch(0.18 0.04 265);
  --sidebar-accent-foreground: oklch(0.88 0.01 220);
  --sidebar-border: oklch(0.22 0.05 265);
  --sidebar-ring: oklch(0.82 0.18 210);
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  
  html {
    color-scheme: dark;
  }
  
  body {
    @apply bg-background text-foreground;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
  }
  
  button:not(:disabled),
  [role="button"]:not([aria-disabled="true"]),
  [type="button"]:not(:disabled),
  [type="submit"]:not(:disabled),
  [type="reset"]:not(:disabled),
  a[href],
  select:not(:disabled),
  input[type="checkbox"]:not(:disabled),
  input[type="radio"]:not(:disabled) {
    @apply cursor-pointer;
  }
}

@layer components {
  .container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .flex {
    min-height: 0;
    min-width: 0;
  }

  @media (min-width: 640px) {
    .container {
      padding-left: 1.5rem;
      padding-right: 1.5rem;
    }
  }

  @media (min-width: 1024px) {
    .container {
      padding-left: 2rem;
      padding-right: 2rem;
      max-width: 1280px;
    }
  }
  
  /* ATLAS Custom Components */
  
  .atlas-metric {
    font-family: var(--font-mono);
    color: var(--atlas-cyan);
  }
  
  .atlas-card {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: var(--radius);
  }
  
  .atlas-card-hover {
    transition: border-color 200ms ease, box-shadow 200ms ease;
  }
  
  .atlas-card-hover:hover {
    border-color: oklch(0.82 0.18 210 / 0.4);
    box-shadow: 0 0 16px oklch(0.82 0.18 210 / 0.08);
  }
  
  .atlas-glow {
    box-shadow: 0 0 20px oklch(0.82 0.18 210 / 0.2);
  }
  
  .atlas-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 150ms ease, background 150ms ease;
    position: relative;
    font-family: var(--font-body);
  }
  
  .atlas-nav-item:hover {
    color: var(--foreground);
    background: var(--accent);
  }
  
  .atlas-nav-item.active {
    color: var(--atlas-cyan);
    background: oklch(0.82 0.18 210 / 0.08);
  }
  
  .atlas-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 60%;
    background: var(--atlas-cyan);
    border-radius: 0 2px 2px 0;
  }
  
  .atlas-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  
  .atlas-status-dot.online {
    background: var(--atlas-green);
    box-shadow: 0 0 6px var(--atlas-green);
    animation: pulse-green 2s ease-in-out infinite;
  }
  
  .atlas-status-dot.offline {
    background: var(--muted-foreground);
  }
  
  .atlas-status-dot.warning {
    background: var(--atlas-amber);
    box-shadow: 0 0 6px var(--atlas-amber);
    animation: pulse-amber 2s ease-in-out infinite;
  }
  
  .atlas-status-dot.error {
    background: var(--atlas-red);
    box-shadow: 0 0 6px var(--atlas-red);
    animation: pulse-red 2s ease-in-out infinite;
  }
  
  .atlas-kpi-card {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: border-color 200ms ease;
  }
  
  .atlas-kpi-card:hover {
    border-color: oklch(0.82 0.18 210 / 0.3);
  }
  
  .atlas-section-header {
    font-family: var(--font-display);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted-foreground);
    padding: 0 0.75rem;
    margin-bottom: 0.25rem;
  }
  
  .atlas-divider {
    height: 1px;
    background: var(--atlas-border);
    margin: 0.5rem 0;
  }
  
  .atlas-badge-cyan {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: var(--font-mono);
    background: oklch(0.82 0.18 210 / 0.12);
    color: var(--atlas-cyan);
    border: 1px solid oklch(0.82 0.18 210 / 0.25);
  }
  
  .atlas-badge-amber {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: oklch(0.75 0.15 75 / 0.12);
    color: var(--atlas-amber);
    border: 1px solid oklch(0.75 0.15 75 / 0.25);
  }
  
  .atlas-badge-green {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: oklch(0.65 0.15 165 / 0.12);
    color: var(--atlas-green);
    border: 1px solid oklch(0.65 0.15 165 / 0.25);
  }
  
  .atlas-badge-red {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: oklch(0.62 0.22 25 / 0.12);
    color: var(--atlas-red);
    border: 1px solid oklch(0.62 0.22 25 / 0.25);
  }
  
  .atlas-input {
    background: var(--atlas-surface);
    border: 1px solid var(--atlas-border);
    color: var(--foreground);
    font-family: var(--font-body);
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    width: 100%;
  }
  
  .atlas-input:focus {
    border-color: var(--atlas-cyan);
    box-shadow: 0 0 0 2px oklch(0.82 0.18 210 / 0.15);
  }
  
  .atlas-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--atlas-cyan);
    color: var(--atlas-navy);
    font-family: var(--font-display);
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    transition: opacity 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  }
  
  .atlas-btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 0 16px oklch(0.82 0.18 210 / 0.3);
  }
  
  .atlas-btn-primary:active {
    transform: scale(0.97);
  }
  
  .atlas-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: var(--muted-foreground);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--atlas-border);
    transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
  }
  
  .atlas-btn-ghost:hover {
    color: var(--foreground);
    border-color: oklch(0.82 0.18 210 / 0.3);
    background: oklch(0.82 0.18 210 / 0.05);
  }
  
  .atlas-btn-ghost:active {
    transform: scale(0.97);
  }
  
  .atlas-scrollbar::-webkit-scrollbar {
    width: 4px;
  }
  
  .atlas-scrollbar::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .atlas-scrollbar::-webkit-scrollbar-thumb {
    background: var(--atlas-border);
    border-radius: 2px;
  }
  
  .atlas-scrollbar::-webkit-scrollbar-thumb:hover {
    background: oklch(0.82 0.18 210 / 0.3);
  }
}

/* Animations */
@keyframes pulse-green {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--atlas-green); }
  50% { opacity: 0.6; box-shadow: 0 0 12px var(--atlas-green); }
}

@keyframes pulse-amber {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--atlas-amber); }
  50% { opacity: 0.6; box-shadow: 0 0 12px var(--atlas-amber); }
}

@keyframes pulse-red {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--atlas-red); }
  50% { opacity: 0.6; box-shadow: 0 0 12px var(--atlas-red); }
}

@keyframes scan-line {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.animate-fade-in-up {
  animation: fade-in-up 250ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

.animate-slide-in-right {
  animation: slide-in-right 250ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

.animate-blink {
  animation: blink 1s step-end infinite;
}

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in-up,
  .animate-slide-in-right,
  .atlas-status-dot.online,
  .atlas-status-dot.warning,
  .atlas-status-dot.error {
    animation: none;
  }
}
