:root {
  --bg-primary: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.75);
  --border-card: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary-blue: #2563eb;
  --primary-blue-glow: rgba(37, 99, 235, 0.35);
  --accent-cyan: #06b6d4;
  
  --success-green: #10b981;
  --success-glow: rgba(16, 185, 129, 0.3);
  --danger-red: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.3);
  --warning-amber: #f59e0b;

  --card-radius: 20px;
  --btn-radius: 16px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
}

.app-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header Card */
.header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--card-radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 26px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 60%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Status Badges */
.status-badge-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.badge-online {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
}
.badge-online .dot {
  background: var(--success-green);
  box-shadow: 0 0 8px var(--success-green);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
}
.badge-pending .dot {
  background: var(--warning-amber);
  box-shadow: 0 0 8px var(--warning-amber);
  animation: pulse 1.5s infinite;
}

.badge-offline {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.25);
}
.badge-offline .dot {
  background: var(--danger-red);
}

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

/* Monitor Card */
.monitor-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--card-radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

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

.monitor-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.timestamp {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Active Display View */
.active-display-view {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition-fast);
}

.state-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.zoom-icon {
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.profile-icon {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.state-info h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.state-info p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* Action Buttons */
.controls-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.btn {
  width: 100%;
  border: none;
  cursor: pointer;
  padding: 16px 20px;
  border-radius: var(--btn-radius);
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.98);
}

.btn-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-title {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.btn-sub {
  font-size: 0.72rem;
  opacity: 0.85;
}

/* Button Variants */
.btn-profile {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px var(--success-glow);
}

.btn-profile:hover {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 6px 24px var(--success-glow);
}

.btn-zoom {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px var(--primary-blue-glow);
}

.btn-zoom:hover {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  box-shadow: 0 6px 24px var(--primary-blue-glow);
}

/* Active Highlight Border */
.btn.is-active {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

/* Transition Lockout Overlay */
.transition-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(8px);
  border-radius: var(--card-radius);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 10;
  transition: opacity 0.2s ease;
}

.transition-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Telemetry & Info Card */
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--card-radius);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

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

.value {
  font-weight: 600;
  color: var(--text-primary);
}

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

.channel-box {
  display: flex;
  gap: 6px;
}

.channel-box input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  width: 140px;
}

.btn-small {
  background: var(--primary-blue);
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

/* Footer */
.footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  padding: 0 8px;
}

/* Slide Navigator Controls */
.slide-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 4px;
  transition: all var(--transition-fast);
}

.slide-controls.hidden {
  display: none !important;
}

.btn-slide {
  background: rgba(30, 41, 59, 0.95);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-slide:hover {
  background: var(--primary-blue);
  border-color: var(--accent-cyan);
}

.btn-slide:active {
  transform: scale(0.95);
}

.slide-indicator {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
