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

:root {
  --loom-primary: #625df5;
  --loom-primary-hover: #504be4;
  --loom-coral: #ff5745;
  --loom-coral-hover: #f04836;
  --loom-dark: #121417;
  --loom-widget-bg: #1e2229;
  --loom-widget-card: #282d37;
  --loom-widget-border: #353b47;
  --loom-green: #10b981;
  --loom-text-light: #f3f4f6;
  --loom-text-muted: #9ca3af;
  --loom-bg: #f8fafc;
  --loom-sidebar: #f3f4f6;
  --loom-card-border: #e5e7eb;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--loom-bg);
  color: #1f2937;
  overflow-x: hidden;
  user-select: none;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Loom Floating Recorder Widget */
.loom-recorder-widget {
  background: var(--loom-widget-bg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  width: 320px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #fff;
  z-index: 9999;
}

/* Device selection subpopup */
.loom-subpopup {
  background: #171a1f;
  border: 1px solid #333a46;
  box-shadow: -8px 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 14px;
  z-index: 10001;
}

/* Floating Left Control Bar (Vertical Pill) */
.loom-floating-bar {
  background: rgba(30, 34, 41, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  width: 52px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 9999;
}

.floating-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.floating-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.floating-btn.active {
  background: var(--loom-primary);
  color: #fff;
}
.floating-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Stop record button with pulsing animation */
.stop-record-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #ef4444;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
  transition: all 0.2s ease;
}
.stop-record-btn:hover {
  transform: scale(1.06);
  background: #dc2626;
}

/* Circular Webcam Bubble */
.loom-camera-bubble {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 9998;
  cursor: grab;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(255, 255, 255, 0.95);
  overflow: hidden;
  background: #111827;
  transition: box-shadow 0.2s ease, width 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.loom-camera-bubble:active {
  cursor: grabbing;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45), 0 0 0 4px var(--loom-primary);
}

.loom-camera-bubble.size-sm {
  width: 120px;
  height: 120px;
}
.loom-camera-bubble.size-md {
  width: 180px;
  height: 180px;
}
.loom-camera-bubble.size-lg {
  width: 260px;
  height: 260px;
}

.loom-camera-bubble video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror view */
  pointer-events: none;
}

/* Camera controls overlay on hover */
.camera-bubble-controls {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.loom-camera-bubble:hover .camera-bubble-controls {
  opacity: 1;
  pointer-events: auto;
}

.bubble-tool-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}
.bubble-tool-btn:hover {
  background: rgba(255, 255, 255, 0.45);
}

/* Audio wave canvas visualizer */
.audio-wave-canvas {
  width: 80px;
  height: 24px;
}

/* Countdown overlay */
.loom-countdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  animation: fadeIn 0.2s ease-out;
}

.countdown-number {
  font-size: 130px;
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  text-shadow: 0 10px 40px rgba(98, 93, 245, 0.8);
  animation: popScale 1s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popScale {
  0% { transform: scale(0.6); opacity: 0; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Reaction burst animations */
.floating-reaction {
  position: absolute;
  font-size: 28px;
  pointer-events: none;
  animation: floatUp 1.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  z-index: 100;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(0.8);
    opacity: 1;
  }
  50% {
    transform: translateY(-80px) scale(1.3) rotate(8deg);
    opacity: 0.9;
  }
  100% {
    transform: translateY(-160px) scale(1) rotate(-8deg);
    opacity: 0;
  }
}

/* Toast alert notification */
.toast-notice {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f2937;
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 100001;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
