/* ==========================================================================
   WakeUp AI - Modern Dark Theme Stylesheet
   Created with CSS Custom Properties, Glassmorphism, & Responsive Layouts
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties / Color System
   -------------------------------------------------------------------------- */
:root {
  /* Color Palette */
  --bg-main: #0b0f19;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2234;
  --bg-glass: rgba(26, 34, 52, 0.75);
  --bg-glass-card: rgba(17, 24, 39, 0.85);
  
  /* Primary & Accent Colors */
  --primary: #6366f1;         /* Indigo */
  --primary-light: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --accent-cyan: #06b6d4;      /* Cyan */
  --accent-cyan-glow: rgba(6, 182, 212, 0.35);
  
  --accent-emerald: #10b981;   /* Emerald Success */
  --accent-emerald-glow: rgba(16, 185, 129, 0.4);
  
  --accent-rose: #f43f5e;      /* Alarm / Danger */
  --accent-rose-glow: rgba(244, 63, 94, 0.45);
  
  --accent-amber: #f59e0b;     /* Warning */
  
  /* Neutral / Text Colors */
  --text-pure: #ffffff;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  /* Typography */
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', var(--font-main);
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Shadows & Glass */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow-rose: 0 0 40px var(--accent-rose-glow);
  --shadow-glow-cyan: 0 0 40px var(--accent-cyan-glow);
  --glass-blur: blur(16px);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   2. Reset & Global Styles
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

/* Background Ambient Lighting */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

.glow-1 {
  width: 450px;
  height: 450px;
  top: -100px;
  right: -50px;
  background: radial-gradient(circle, var(--primary), transparent 70%);
}

.glow-2 {
  width: 500px;
  height: 500px;
  bottom: -150px;
  left: -100px;
  background: radial-gradient(circle, var(--accent-cyan), transparent 70%);
}

/* Gradient Text Helper */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-cyan), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --------------------------------------------------------------------------
   3. Header Section
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.5rem;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow-cyan);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Model Status Badge */
.model-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-normal);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
  animation: pulse-dot 1.5s infinite alternate;
}

.model-status-badge.ready .status-dot {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: none;
}

.model-status-badge.ready {
  border-color: rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

.model-status-badge.error .status-dot {
  background-color: var(--accent-rose);
  box-shadow: 0 0 10px var(--accent-rose);
}

@keyframes pulse-dot {
  0% { opacity: 0.4; transform: scale(0.9); }
  100% { opacity: 1; transform: scale(1.1); }
}

/* --------------------------------------------------------------------------
   4. Main Container & Layout
   -------------------------------------------------------------------------- */
.main-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
  position: relative;
  z-index: 10;
}

.section-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.4s ease-out;
}

/* --------------------------------------------------------------------------
   5. Clock Display Card
   -------------------------------------------------------------------------- */
.clock-display-card {
  background: var(--bg-glass-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.clock-display-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}

.clock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

.current-time {
  font-family: var(--font-mono);
  font-size: clamp(2.8rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-pure);
  text-shadow: 0 0 30px rgba(99, 102, 241, 0.4);
}

.current-date {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   6. Active Alarm Banner
   -------------------------------------------------------------------------- */
.active-alarm-banner {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  animation: slideDown 0.3s ease-out;
}

.alarm-banner-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.alarm-bell-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 15px var(--primary-glow);
}

.alarm-bell-icon.animated-ring {
  animation: ring-swing 2.5s infinite ease-in-out;
}

.banner-subtitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.banner-time {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--text-pure);
  font-weight: 700;
}

.banner-countdown {
  display: block;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   7. Card Grid & Sub-Cards
   -------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.sub-card {
  background: var(--bg-glass-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.sub-card:hover {
  border-color: var(--border-medium);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.card-header-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  flex-shrink: 0;
}

.card-header-icon.highlight-icon {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-pure);
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   8. Alarm Form & Time Input
   -------------------------------------------------------------------------- */
.alarm-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.time-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.input-field-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.input-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.time-box {
  width: 85px;
  height: 65px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-pure);
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: var(--transition-fast);
}

.time-box:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.time-separator {
  font-size: 2.5rem;
  font-family: var(--font-mono);
  color: var(--primary-light);
  font-weight: 700;
  margin-top: 1rem;
}

/* Preset Chips */
.preset-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.preset-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.preset-chip:hover {
  background: rgba(99, 102, 241, 0.2);
  color: var(--text-pure);
  border-color: var(--primary-light);
}

/* Form Actions Buttons */
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Generic Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-normal);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-accent {
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #67e8f9;
}

.btn-accent:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: var(--accent-cyan);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-ghost-danger {
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fb7185;
}

.btn-ghost-danger:hover {
  background: rgba(244, 63, 94, 0.15);
  border-color: var(--accent-rose);
  color: #fff;
}

.btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* --------------------------------------------------------------------------
   9. Objects & Model Settings Section
   -------------------------------------------------------------------------- */
.objects-list-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.objects-chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.object-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
}

.object-badge i {
  color: var(--accent-cyan);
}

.object-badge.skeleton {
  color: var(--text-muted);
  font-style: italic;
}

/* Model Config Accordion */
.model-settings-toggle {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.75rem;
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  cursor: pointer;
  padding: 0.4rem 0;
  transition: var(--transition-fast);
}

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

.chevron-icon {
  transition: transform var(--transition-normal);
}

.toggle-btn.open .chevron-icon {
  transform: rotate(180deg);
}

.model-config-panel {
  margin-top: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.input-with-action {
  display: flex;
  gap: 0.5rem;
}

.text-input {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-pure);
  padding: 0.6rem 0.85rem;
  font-size: 0.85rem;
  outline: none;
  font-family: var(--font-mono);
}

.text-input:focus {
  border-color: var(--primary-light);
}

.help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.help-text code {
  color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 4px;
  border-radius: 4px;
}

/* Guide Box */
.guide-box {
  background: rgba(99, 102, 241, 0.05);
  border: 1px dashed rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guide-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.guide-number {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   10. Ringing Mode & Active Detection View
   -------------------------------------------------------------------------- */
.ringing-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: alarmPulseScreen 1.5s infinite alternate;
}

/* Alarm Alert Flashing Header */
.alarm-alert-header {
  text-align: center;
  background: rgba(244, 63, 94, 0.15);
  border: 2px solid var(--accent-rose);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-glow-rose);
}

.alarm-flashing-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  font-weight: 800;
  color: #fecdd3;
  letter-spacing: 1px;
}

.pulsing-icon {
  color: var(--accent-rose);
  animation: flame-pulse 0.8s infinite alternate;
}

.alarm-instruction-sub {
  font-size: 0.9rem;
  color: #fda4af;
  margin-top: 0.25rem;
}

/* Target Challenge Card */
.target-challenge-card {
  background: var(--bg-glass-card);
  border: 2px solid var(--accent-cyan);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-glow-cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.target-challenge-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
}

.target-object-name {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 6vw, 2.75rem);
  font-weight: 800;
  color: var(--text-pure);
  background: linear-gradient(135deg, #ffffff, #a5f3fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.target-icon {
  color: var(--accent-cyan);
  width: 36px;
  height: 36px;
}

.target-hint {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.target-hint strong {
  color: var(--accent-emerald);
}

/* Camera & Prediction Grid */
.camera-detection-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .camera-detection-grid {
    grid-template-columns: 1fr;
  }
}

/* Camera Viewport */
.camera-viewport-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.viewport-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cam-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-rose);
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-rose);
  box-shadow: 0 0 10px var(--accent-rose);
  animation: pulse-dot 1s infinite alternate;
}

.webcam-canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.webcam-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.webcam-box canvas, .webcam-box video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror camera feed for natural experience */
}

.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
}

.spin-icon {
  width: 32px;
  height: 32px;
  animation: spin 1s linear infinite;
  color: var(--accent-cyan);
}

/* Circular Hold Progress Ring Overlay */
.hold-progress-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 15, 25, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.hold-progress-overlay.active {
  opacity: 1;
}

.hold-ring-wrapper {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle {
  transition: stroke-dashoffset 0.1s linear;
}

.hold-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hold-text span {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.hold-text small {
  font-size: 0.65rem;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--accent-emerald);
}

/* Predictions Panel */
.predictions-panel {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.predictions-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent-cyan);
  font-size: 1rem;
  font-weight: 700;
}

.prediction-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.prediction-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.65rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.prediction-item.target-matched {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.prediction-item.is-target {
  border-left: 4px solid var(--accent-cyan);
}

.pred-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.pred-name {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pred-target-tag {
  background: var(--accent-cyan);
  color: #0b0f19;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.pred-percentage {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-secondary);
}

.prediction-item.target-matched .pred-percentage {
  color: var(--accent-emerald);
}

.pred-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.pred-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.1s linear, background-color 0.2s ease;
}

.prediction-item.target-matched .pred-bar-fill {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  box-shadow: 0 0 10px var(--accent-emerald);
}

/* Fallback controls */
.alarm-controls-fallback {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.emergency-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* --------------------------------------------------------------------------
   11. Success Modal
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 40px rgba(16, 185, 129, 0.2);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-icon-badge {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 25px var(--accent-emerald-glow);
}

.success-icon-badge i {
  width: 36px;
  height: 36px;
}

.success-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-pure);
}

.success-message {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.success-message strong {
  color: var(--accent-cyan);
}

.success-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

.stat-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.stat-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-pure);
}

/* --------------------------------------------------------------------------
   12. Audio Notice & Footer
   -------------------------------------------------------------------------- */
.audio-notice {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-full);
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 90;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

.notice-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.app-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  position: relative;
  z-index: 10;
}

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

/* --------------------------------------------------------------------------
   13. Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes ring-swing {
  0%, 100% { transform: rotate(0); }
  10%, 30%, 50%, 70%, 90% { transform: rotate(14deg); }
  20%, 40%, 60%, 80% { transform: rotate(-14deg); }
}

@keyframes flame-pulse {
  from { transform: scale(1); filter: drop-shadow(0 0 4px var(--accent-rose)); }
  to { transform: scale(1.25); filter: drop-shadow(0 0 12px var(--accent-rose)); }
}

@keyframes alarmPulseScreen {
  0% {
    box-shadow: inset 0 0 20px rgba(244, 63, 94, 0.05);
  }
  100% {
    box-shadow: inset 0 0 80px rgba(244, 63, 94, 0.2);
  }
}

/* --------------------------------------------------------------------------
   14. Media Queries & Responsive Design
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .main-container {
    padding: 1rem;
  }

  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .time-input-group {
    padding: 1rem 0.5rem;
  }

  .time-box {
    width: 70px;
    height: 55px;
    font-size: 1.6rem;
  }

  .active-alarm-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .banner-time {
    font-size: 1.3rem;
  }

  .audio-notice {
    width: 90%;
    border-radius: var(--radius-md);
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}
