/* ==========================================================================
   EngineeringOpsKit - Custom Theme & Design System Stylesheet
   Direction: RTL | Typography: Tajawal & JetBrains Mono | Theme: Dark Slate
   ========================================================================== */

:root {
  --bg-base: #090d16;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-card: rgba(15, 23, 42, 0.75);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(34, 197, 94, 0.4);
  --emerald-primary: #22c55e;
  --emerald-glow: #4ade80;
  --emerald-dark: #15803d;
  --amber-accent: #f59e0b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-arabic: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace, Consolas, Monaco;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-arabic);
  direction: rtl;
}

body {
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

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

::-webkit-scrollbar-track {
  background: #090d16;
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 5px;
  border: 2px solid #090d16;
}

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

/* ==========================================================================
   Typography & Monospace Elements
   ========================================================================== */
.font-mono-code {
  font-family: var(--font-mono);
  direction: ltr;
  text-align: left;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Glassmorphism & Surface Utilities
   ========================================================================== */
.glass-nav {
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-nav.scrolled {
  background: rgba(9, 13, 22, 0.95);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  border-bottom-color: rgba(34, 197, 94, 0.15);
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 1rem;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 12px 32px -8px rgba(34, 197, 94, 0.12);
}

.glass-panel-elevated {
  background: rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
}

/* ==========================================================================
   Background Grid & Glowing Radiant Orbs
   ========================================================================== */
.bg-grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse at 50% 30%, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 40%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

.glow-orb-primary {
  position: absolute;
  width: 650px;
  height: 650px;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(34, 197, 94, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.glow-orb-secondary {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, rgba(15, 23, 42, 0) 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   Code Preview & Terminal Window Container
   ========================================================================== */
.terminal-window {
  background: #0b1120;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.875rem;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
}

.terminal-header {
  background: #0f172a;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.terminal-dots {
  display: flex;
  gap: 0.4rem;
}

.terminal-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 9999px;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #eab308; }
.dot-green { background: #22c55e; }

/* Code Syntax Highlighting Classes */
.token-key { color: #38bdf8; }
.token-string { color: #4ade80; }
.token-number { color: #f59e0b; }
.token-boolean { color: #ec4899; }
.token-comment { color: #64748b; font-style: italic; }
.token-header { color: #cbd5e1; }

/* ==========================================================================
   Custom Range Sliders for ROI Calculator
   ========================================================================== */
input[type="range"].custom-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: #1e293b;
  outline: none;
  cursor: pointer;
  direction: ltr; /* Sliders are LTR for consistent thumb handling */
}

input[type="range"].custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid #090d16;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"].custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.8);
}

input[type="range"].custom-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid #090d16;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* ==========================================================================
   Buttons & Micro-Interactions
   ========================================================================== */
.btn-emerald {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #052e16;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 18px -2px rgba(34, 197, 94, 0.4);
}

.btn-emerald:hover {
  background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -2px rgba(34, 197, 94, 0.6);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.7);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ==========================================================================
   Badge Styles
   ========================================================================== */
.badge-emerald {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #4ade80;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
}

.badge-amber {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 9999px;
}
