/**
 * Thrum UI Design System
 * Data Terminal / Mission Control Aesthetic
 *
 * Based on: ui/packages/web-app/src/index.css
 * Task: thrum-235d.2
 */

/* ============================================================================
   FONTS
   ========================================================================= */

/* IBM Plex Mono - Technical/Monospace */
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibm-plex-mono-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibm-plex-mono-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibm-plex-mono-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../assets/fonts/ibm-plex-mono-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Inter - Body Text */
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ============================================================================
   CSS VARIABLES (Design Tokens)
   ========================================================================= */

:root {
  /* Background Colors */
  --bg-base: #0a0e1a;              /* Deep navy base */
  --bg-panel-dark: #0f172a;        /* Dark panel */
  --bg-panel-light: #1e293b;       /* Light panel */

  /* Primary Accent (Cyan) */
  --primary: #38bdf8;              /* Main cyan */
  --primary-dark: #0891b2;         /* Darker cyan */
  --primary-light: #06b6d4;        /* Lighter cyan */
  --primary-hover: #0ea5e9;        /* Hover state */

  /* Status Colors */
  --success: #10b981;              /* Green - online/active */
  --destructive: #ef4444;          /* Red - alerts */
  --destructive-dark: #dc2626;     /* Darker red */

  /* Text Hierarchy */
  --text-primary: #e2e8f0;         /* Primary text */
  --text-secondary: #cbd5e1;       /* Secondary text */
  --text-muted: #94a3b8;           /* Muted text */
  --text-subtle: #64748b;          /* Subtle text */

  /* Borders */
  --border: rgba(56, 189, 248, 0.2);        /* Cyan at 20% */
  --border-hover: rgba(56, 189, 248, 0.4);  /* Cyan at 40% */

  /* Fonts */
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 40px;
  --space-3xl: 48px;

  /* Border Radius (Sharp aesthetic) */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  /* Shadows (Glowing) */
  --shadow-sm: 0 0 10px rgba(56, 189, 248, 0.1);
  --shadow-md: 0 0 20px rgba(56, 189, 248, 0.1);
  --shadow-lg: 0 0 30px rgba(56, 189, 248, 0.15);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.6);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

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

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(180deg, var(--bg-panel-dark) 0%, var(--bg-panel-light) 100%);
  min-height: 100vh;
  position: relative;
}

/* Grid background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.03;
  pointer-events: none;
  z-index: -1;
}

/* ============================================================================
   TYPOGRAPHY
   ========================================================================= */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: 0.5px;
}

h1 {
  font-size: 48px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 30px rgba(56, 189, 248, 0.5);
}

h2 {
  font-size: 32px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

h3 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 1px;
}

h4 {
  font-size: 18px;
  font-weight: 600;
}

h5 {
  font-size: 16px;
  font-weight: 500;
}

h6 {
  font-size: 14px;
  font-weight: 500;
}

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

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

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: rgba(56, 189, 248, 0.1);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

pre {
  font-family: var(--font-mono);
  background-color: var(--bg-panel-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  overflow-x: auto;
  margin: var(--space-md) 0;
  box-shadow: var(--shadow-sm);
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
}

blockquote {
  border-left: 4px solid var(--primary);
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background-color: rgba(15, 23, 42, 0.8);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
}

/* ============================================================================
   BUTTONS
   ========================================================================= */

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: rgba(56, 189, 248, 0.1);
  text-decoration: none;
}

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

.btn-ghost:hover {
  background: rgba(56, 189, 248, 0.05);
  text-decoration: none;
}

.btn-destructive {
  background: var(--destructive);
  color: white;
  border-color: var(--destructive-dark);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.btn-destructive:hover {
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.6);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ============================================================================
   CARDS & PANELS
   ========================================================================= */

.card {
  background: linear-gradient(180deg, var(--bg-panel-dark), var(--bg-panel-light));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.card-interactive {
  cursor: pointer;
}

.card-interactive:hover {
  transform: translateY(-4px);
}

.panel {
  background: var(--bg-panel-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

/* ============================================================================
   BADGES & CHIPS
   ========================================================================= */

.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-success {
  color: var(--success);
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-destructive {
  color: var(--destructive);
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

/* ============================================================================
   NAVIGATION
   ========================================================================= */

.nav-item {
  display: block;
  padding: 12px var(--space-md);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-left: 2px solid transparent;
  transition: all var(--transition-base);
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(56, 189, 248, 0.05);
  text-decoration: none;
}

.nav-item.active {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border-left-color: var(--primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

/* ============================================================================
   CONTAINERS & LAYOUT
   ========================================================================= */

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

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Grid Systems */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

/* ============================================================================
   UTILITIES
   ========================================================================= */

.text-mono {
  font-family: var(--font-mono);
}

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-subtle {
  color: var(--text-subtle);
}

.text-cyan {
  color: var(--primary);
}

.text-center {
  text-align: center;
}

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: 1px;
}

.glow {
  box-shadow: var(--shadow-glow);
}

.hidden {
  display: none !important;
}

/* Status indicator dot */
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: var(--space-sm);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success), 0 0 3px var(--success) inset;
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.offline {
  background: var(--text-subtle);
}

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

/* ============================================================================
   TABLES
   ========================================================================= */

table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

thead {
  background-color: rgba(15, 23, 42, 0.8);
}

th {
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: left;
  padding: 12px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: rgba(56, 189, 248, 0.05);
}

/* ============================================================================
   RESPONSIVE
   ========================================================================= */

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

@media (max-width: 768px) {
  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 20px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .container,
  .container-wide,
  .container-narrow {
    padding: 0 var(--space-md);
  }
}

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

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

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

@keyframes glow {
  from {
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
  }
  to {
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
  }
}

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

.slide-up {
  animation: slideUp 0.5s ease;
}

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

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

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

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-sm);
}

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

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg-panel-dark);
}
