@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&family=Caveat:wght@600;700&display=swap');

:root {
  --bg-dark: #070d12;
  --bg-card: rgba(11, 23, 30, 0.88);
  --bg-card-hover: rgba(15, 30, 39, 0.95);
  --border-card: #152d38;
  --border-glow: #10b981;
  --accent-green: #10b981;
  --accent-glow: #00e676;
  --accent-cyan: #06b6d4;
  --accent-text: #34d399;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: #e2e8f0;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(6, 182, 212, 0.06) 0%, transparent 35%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  background-attachment: fixed;
  overflow-x: hidden;
}

.font-mono-code {
  font-family: 'JetBrains Mono', monospace;
}

.font-handwriting {
  font-family: 'Caveat', cursive;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #09131a;
}
::-webkit-scrollbar-thumb {
  background: #1b3846;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #10b981;
}

/* Glassmorphism & Cyber Card */
.cyber-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
  min-width: 0; /* Prevents grid blowout on nested flex/grid elements */
}

.cyber-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.35), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cyber-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.7), 0 0 16px -2px rgba(16, 185, 129, 0.15);
  transform: translateY(-2px);
}

.cyber-card:hover::before {
  opacity: 1;
}

/* Card Header Numbering */
.card-header-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.card-caption {
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.35;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.5rem;
  margin-top: auto;
}

/* Cyber Form Inputs */
.cyber-input {
  background: rgba(7, 15, 20, 0.85);
  border: 1px solid #163442;
  color: #f8fafc;
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

.cyber-input:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.cyber-select {
  background-color: #08141b;
  border: 1px solid #163442;
  color: #f8fafc;
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  outline: none;
  width: 100%;
}

.cyber-select:focus {
  border-color: #10b981;
}

/* Green Glow Buttons */
.btn-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  cursor: pointer;
}

.btn-emerald:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.btn-outline-emerald {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid #10b981;
  color: #34d399;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-outline-emerald:hover {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: #34d399;
}

.btn-dark {
  background: #0d1e26;
  border: 1px solid #1e3c4a;
  color: #cbd5e1;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-dark:hover {
  background: #142d3a;
  color: #ffffff;
  border-color: #275264;
}

/* Custom Cyber Checkbox */
.cyber-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid #234857;
  border-radius: 3px;
  background: #09151c;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.cyber-checkbox:checked {
  background: #10b981;
  border-color: #10b981;
}

.cyber-checkbox:checked::before {
  content: "";
  width: 6px;
  height: 6px;
  background-color: white;
  transform: scale(1);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

/* Custom Cyber Switch Toggle */
.cyber-switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
}

.cyber-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cyber-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #172d38;
  transition: 0.25s;
  border-radius: 18px;
  border: 1px solid #234554;
}

.cyber-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: #94a3b8;
  transition: 0.25s;
  border-radius: 50%;
}

input:checked + .cyber-slider {
  background-color: #059669;
  border-color: #10b981;
}

input:checked + .cyber-slider:before {
  transform: translateX(14px);
  background-color: #ffffff;
}

/* Range Slider */
input[type="range"] {
  accent-color: #10b981;
}

/* Terminal & Console */
.cyber-terminal {
  background: #050b0e;
  border: 1px solid #142831;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #34d399;
  padding: 0.6rem;
  overflow-y: auto;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* OLED Simulation Screen */
.oled-screen {
  background: #020608;
  border: 2px solid #06b6d4;
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.25), inset 0 0 12px rgba(6, 182, 212, 0.15);
  font-family: 'JetBrains Mono', monospace;
  position: relative;
  overflow: hidden;
}

.oled-screen::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(0deg, rgba(6, 182, 212, 0.04), rgba(6, 182, 212, 0.04) 1px, transparent 1px, transparent 2px);
  pointer-events: none;
}

/* Camera HUD Overlay */
.camera-hud {
  position: relative;
  background: #04090c;
  border: 1px solid #15323d;
  border-radius: 8px;
  overflow: hidden;
}

.camera-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border: 2px dashed rgba(16, 185, 129, 0.7);
  border-radius: 8px;
  pointer-events: none;
  animation: pulse-hud 2s infinite ease-in-out;
}

@keyframes pulse-hud {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    border-color: rgba(16, 185, 129, 0.7);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    border-color: rgba(52, 211, 153, 0.95);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  }
}

/* Voice Waveform Bars */
.waveform-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 28px;
}

.wave-bar {
  width: 3px;
  background: #10b981;
  border-radius: 2px;
  animation: wave-anim 1.2s infinite ease-in-out;
}

.wave-bar:nth-child(1) { height: 8px; animation-delay: 0.1s; }
.wave-bar:nth-child(2) { height: 16px; animation-delay: 0.2s; }
.wave-bar:nth-child(3) { height: 24px; animation-delay: 0.3s; }
.wave-bar:nth-child(4) { height: 12px; animation-delay: 0.4s; }
.wave-bar:nth-child(5) { height: 20px; animation-delay: 0.5s; }
.wave-bar:nth-child(6) { height: 26px; animation-delay: 0.6s; }
.wave-bar:nth-child(7) { height: 14px; animation-delay: 0.7s; }
.wave-bar:nth-child(8) { height: 8px; animation-delay: 0.8s; }

@keyframes wave-anim {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1.2); }
}

/* Pulsing Badge & Rings */
.pulse-green {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  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 10px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Modal Backdrop */
.modal-backdrop {
  background: rgba(4, 9, 13, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

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

/* Ensure form controls and buttons fit properly inside cards */
.cyber-input, .cyber-select, .btn-dark, .btn-emerald, .btn-outline-emerald {
  max-width: 100%;
}

/* Responsive Table scrollbar */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mobile & Tablet Optimizations */
@media (max-width: 640px) {
  body {
    background-size: 100% 100%, 100% 100%, 100% 100%, 20px 20px, 20px 20px;
  }

  .cyber-card {
    padding: 0.85rem !important;
    border-radius: 10px;
  }

  .card-header-badge {
    font-size: 0.8rem;
  }

  .card-caption {
    font-size: 0.7rem;
    padding-top: 0.4rem;
  }

  .btn-emerald, .btn-dark, .btn-outline-emerald {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* Medium screen adjustments (tablets & 13-inch laptops) */
@media (min-width: 641px) and (max-width: 1280px) {
  .cyber-card {
    padding: 1rem !important;
  }
}

