/* Global Reset & Utilities */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Google Font */
body {
  font-family: "Outfit", sans-serif;
  background: #1f2937; /* dark gray */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><filter id='noiseFilter'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23noiseFilter)'/></svg>");
  background-size: 200px;
  background-blend-mode: overlay;
  min-height: 100vh;
  color: #e5e7eb;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Headings */
.header {
  text-align: center;
  padding: 20px 15px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1,
.header h2 {
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.header h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.header .subtitle {
  font-size: 0.9rem;
  opacity: 0.8;
  font-weight: 400;
}

/* Video Containers */
.camera-container {
  position: relative;
  width: 100%;
  background: #000;
}

video {
  width: 100%;
  height: auto;
  display: block;
  background: #111827;
}

.video-wrap {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  margin: 0 auto;
  width: 360px;
  max-width: 100%;
  min-height: 200px;
}

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* Status boxes */
#phone-status,
#status {
  background: rgba(55, 65, 81, 0.9);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: "Outfit", monospace;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

/* Connection indicator */
.connection-indicator {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
  animation: pulse 2s infinite;
  z-index: 20;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* Buttons */
.control-btn,
button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(6px);
  transition: all 0.2s ease;
  cursor: pointer;
}

.control-btn:hover,
button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Debug cards */
.card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #4facfe;
}

.debug-item label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.debug-item span {
  font-family: "Outfit", monospace;
  font-size: 14px;
  color: #f3f4f6;
  font-weight: 500;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-ready {
  background: #c6f6d5;
  color: #22543d;
}
.status-loading {
  background: #fed7d7;
  color: #c53030;
}
.status-running {
  background: #bee3f8;
  color: #2a69ac;
}
.status-failed {
  background: #fed7d7;
  color: #c53030;
}

/* Helpers (kept from before) */
.text-center {
  text-align: center;
}
.hidden-mobile {
  display: block;
}
@media (max-width: 768px) {
  .hidden-mobile {
    display: none;
  }
  .mobile-only {
    display: block;
  }
  .header h1 {
    font-size: 2rem;
  }
}
.mobile-only {
  display: none;
}

/* Video loading placeholder */
.loading-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  background: rgba(31, 41, 55, 0.8); /* dark gray */
  border-radius: 16px;
  color: #e5e7eb;
  font-size: 1.1rem;
  gap: 16px;
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #4facfe;
  animation: spin 1s ease-in-out infinite;
}

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