/* Auto-Labeler Studio: ChatGPT + Claude Dark Aesthetic */

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

:root {
  --bg-primary: #0f1013;
  --bg-secondary: #17181c;
  --bg-tertiary: #1f2026;
  --bg-card: #262830;
  --border-subtle: #2d3039;
  --border-strong: #3f4350;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --brand-purple: #7c3aed;
  --brand-purple-light: #a78bfa;
  --brand-orange: #ea580c;
  --brand-emerald: #10b981;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* JetBrains Mono for coordinates, code, and badges */
code, pre, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* ========================================================================== */
/* Strict Interactive Annotation Studio Layout (Never scrolls, never shrinks) */
/* ========================================================================== */

body.in-studio {
  overflow: hidden !important;
  height: 100vh !important;
  max-height: 100vh !important;
}

#viewStudio:not(.hidden) {
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  height: calc(100vh - 3.5rem) !important;
  max-height: calc(100vh - 3.5rem) !important;
  overflow: hidden !important;
  position: relative !important;
}

#viewStudio > aside {
  width: 420px !important;
  min-width: 420px !important;
  max-width: 420px !important;
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
  border-right: 1px solid #27272a;
}

#studioRightPanel {
  flex: 1 1 0% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  position: relative !important;
  background-color: #0d0e11;
}

#studioTopControlBar {
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  flex-shrink: 0 !important;
  border-bottom: 1px solid #27272a;
}

/* Canvas Viewport Checkerboard/Blueprint Dark Background */
#canvasViewport {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: #0b0c0e !important;
  background-image: 
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0) !important;
  background-size: 24px 24px !important;
}

/* Canvas Glow and Centered Rendering */
#annotationCanvas {
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.7));
  border-radius: 4px;
  image-rendering: auto;
  transform-origin: center center;
  max-width: none !important;
  max-height: none !important;
  display: block;
}

#queueSection {
  height: 80px !important;
  min-height: 80px !important;
  max-height: 80px !important;
  flex-shrink: 0 !important;
  border-top: 1px solid #27272a;
}

#yoloInspectorSection {
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  flex-shrink: 0 !important;
  border-top: 1px solid rgba(39, 39, 42, 0.8);
}

/* Drag and Drop Zone hover animations */
#dropZone {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#dropZone.drag-over {
  border-color: #8b5cf6 !important;
  background-color: rgba(139, 92, 246, 0.08) !important;
  transform: scale(1.01);
}

/* Thumbnail Queue Items */
.thumb-item {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 2px solid transparent;
  overflow: visible;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  background: #111;
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.thumb-del-btn {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: #ef4444;
  color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  pointer-events: auto;
  transition: opacity 0.15s ease, transform 0.1s ease, background 0.15s ease;
  z-index: 30;
  cursor: pointer;
}

.thumb-item:hover .thumb-del-btn {
  opacity: 1;
}

.thumb-del-btn:hover {
  background: #dc2626;
  transform: scale(1.2);
}

.thumb-item.active {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
}

.thumb-item .thumb-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Button pulse on active run */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
  }
  50% {
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.8);
  }
}

.running-glow {
  animation: pulseGlow 1.5s infinite ease-in-out;
}

/* Tooltip floating box */
#boxTooltip {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.7);
}

/* Inputs smooth focus */
input, textarea, select {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: #8b5cf6 !important;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Box Visibility & Styling Popover */
#boxVisibilityPopover {
  animation: fadeInDown 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 10px 10px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

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

.stroke-preset-btn.active {
  background-color: #8b5cf6 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-color: #a78bfa !important;
}

.color-swatch-btn {
  position: relative;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.color-swatch-btn:hover {
  transform: scale(1.12);
  z-index: 5;
}

.color-swatch-btn.active {
  box-shadow: 0 0 0 2px #ffffff, 0 0 8px rgba(255, 255, 255, 0.6);
  transform: scale(1.08);
}

.color-swatch-btn.active::after {
  content: '✓';
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.9), 0 0 1px rgba(0, 0, 0, 0.9);
}

/* Keyboard Shortcut Key Badges */
.shortcut-key-btn {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  background: #18181b;
  color: #e4e4e7;
  border: 1px solid #3f3f46;
  box-shadow: 0 2px 0 #27272a, inset 0 1px 0 rgba(255, 255, 255, 0.1);
  min-width: 48px;
  text-align: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.shortcut-key-btn:hover {
  background: #27272a;
  color: #ffffff;
  border-color: #71717a;
}

.shortcut-key-btn.recording {
  background: #4c1d95 !important;
  border-color: #c084fc !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.7) !important;
  animation: pulseRecording 1s infinite alternate;
}

@keyframes pulseRecording {
  from { transform: scale(1); border-color: #a855f7; }
  to { transform: scale(1.04); border-color: #e9d5ff; }
}
