:root {
  --color-primary: #FF6B00;
  --color-primary-glow: rgba(255, 107, 0, 0.45);
  --color-primary-hover: #FF8533;
  --color-bg-deep: #090A0F;
  --color-card-bg: rgba(18, 20, 29, 0.85);
  --color-card-border: rgba(255, 107, 0, 0.18);
  --color-card-hover-border: rgba(255, 107, 0, 0.45);
  --color-text-main: #F3F4F6;
  --color-text-muted: #9CA3AF;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--font-main);
  background-color: var(--color-bg-deep);
  color: var(--color-text-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(255, 107, 0, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(255, 60, 0, 0.06) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ================= CYBER CARD & GLASSMORPHISM ================= */

.cyber-card {
  background: var(--color-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-card-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cyber-card:hover {
  border-color: var(--color-card-hover-border);
  box-shadow: 0 10px 36px 0 rgba(255, 107, 0, 0.12);
}

/* Fiery Orange Glow Effects */
.glow-orange {
  box-shadow: 0 0 20px var(--color-primary-glow);
}

.glow-orange-text {
  text-shadow: 0 0 12px var(--color-primary-glow);
}

.glow-orange-sm {
  box-shadow: 0 0 10px var(--color-primary-glow);
}

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

.btn-primary {
  background: linear-gradient(135deg, #FF6B00 0%, #FF8800 100%);
  color: #000;
  font-weight: 700;
  border: none;
  box-shadow: 0 4px 18px rgba(255, 107, 0, 0.35);
  transition: all 0.2s ease;
  user-select: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #FF7D1A 0%, #FFA033 100%);
  box-shadow: 0 6px 24px rgba(255, 107, 0, 0.6);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-danger {
  background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
  color: #FFF;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
  transition: all 0.2s ease;
}

.btn-danger:hover {
  box-shadow: 0 6px 22px rgba(239, 68, 68, 0.55);
  transform: translateY(-1px);
}

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

.tab-btn {
  user-select: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.tab-btn.active {
  background: rgba(255, 107, 0, 0.15) !important;
  color: #FF6B00 !important;
  border-color: rgba(255, 107, 0, 0.4) !important;
  box-shadow: 0 0 16px rgba(255, 107, 0, 0.2);
}

/* ================= CYBER TERMINAL CONTAINER ================= */

.cyber-terminal {
  background: #05060A;
  border: 1px solid rgba(255, 107, 0, 0.25);
  font-family: var(--font-mono);
  color: #D1D5DB;
  font-size: 0.85rem;
  line-height: 1.5;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* ================= SCROLLBAR CUSTOMIZATION ================= */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 12, 18, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 107, 0, 0.4);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #FF6B00;
}

/* Hide scrollbar utility */
.scrollbar-none::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.scrollbar-none,
.no-scrollbar {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

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

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.95);
    opacity: 0.85;
  }
}

@keyframes pulseOrange {
  0%, 100% {
    box-shadow: 0 0 8px rgba(255, 107, 0, 0.6);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 24px rgba(255, 107, 0, 0.95);
    opacity: 0.8;
  }
}

.badge-live-pulse {
  animation: pulseGlow 2s infinite ease-in-out;
}

.badge-reconnect-pulse {
  animation: pulseOrange 1.2s infinite ease-in-out;
}

/* Live Sync Radar & Ticker Glow */
@keyframes liveRadarPulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.live-radar-active {
  animation: liveRadarPulse 1.8s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

.live-switch-active {
  background: rgba(16, 185, 129, 0.1) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}

.live-switch-paused {
  background: rgba(39, 39, 42, 0.5) !important;
  border-color: rgba(63, 63, 70, 0.7) !important;
}

.live-switch-paused * {
  color: #9CA3AF !important;
}

/* ================= PROGRESS BARS ================= */

.cyber-progress-bg {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cyber-progress-fill {
  background: linear-gradient(90deg, #FF6B00, #FFA500);
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.5);
  transition: width 0.4s ease;
}

/* ================= TOAST NOTIFICATION CONTAINER ================= */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

.toast {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(18, 20, 28, 0.95);
  border-left: 4px solid #FF6B00;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  animation: slideInToast 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

@keyframes slideInToast {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ================= RANGE INPUTS ================= */

input[type=range] {
  accent-color: #FF6B00;
}

/* ================= MOBILE VIEW OPTIMIZATION (< 768px) ================= */

@media (max-width: 768px) {
  /* Tighten card padding for maximum screen real estate */
  .cyber-card {
    padding: 0.875rem !important;
    border-radius: 1rem !important;
  }

  /* Main container margins */
  main {
    padding: 0.75rem !important;
  }

  /* Smooth momentum touch scrolling */
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch !important;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
  }

  /* Ensure tables don't compress into tiny unreadable columns */
  .overflow-x-auto table {
    min-width: 580px;
  }

  /* Header adjustments on mobile */
  header {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    padding-top: 0.625rem !important;
    padding-bottom: 0.5rem !important;
  }

  /* Mobile typography tuning */
  h1 {
    font-size: 1.1rem !important;
  }

  /* Prevent automatic iOS zoom on focus */
  input, select, textarea {
    font-size: 14px !important;
  }

  /* Toast notification on mobile */
  #toast-container {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: 100%;
  }

  /* Chart containers mobile aspect ratio */
  .h-72, .h-64, .h-60 {
    height: 14rem !important;
  }

  /* Modals on mobile */
  #docker-logs-modal > div {
    max-height: 92vh !important;
    margin: 0.5rem;
  }

  #docker-logs-modal-body {
    font-size: 10px !important;
    padding: 0.75rem !important;
  }
}

/* Extra small devices (< 480px) */
@media (max-width: 480px) {
  .cyber-card {
    padding: 0.75rem !important;
  }

  /* Smaller header status badge */
  #header-status-badge {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  /* Metric cards number size */
  .text-3xl {
    font-size: 1.5rem !important;
  }

  .text-2xl {
    font-size: 1.25rem !important;
  }
}
