/**
 * Global styles for the renderer process.
 *
 * Imports Tailwind CSS base/components/utilities layers, then adds global resets
 * (box-sizing, zero margins), dark-theme scrollbar styling, a focus-within border
 * indicator for panel containers, Monaco search highlight decorations, and the
 * macOS-style draggable title bar region rules.
 */
@tailwind base;
@tailwind components;
@tailwind utilities;

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

html, body, #root {
  height: 100%;
  overflow: clip;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar for dark theme */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 4px;
}

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

/* Focus indicator for panels — ::after overlay sits above panel content (including overflow).
   No transition to avoid flicker during rapid focus changes. */
[data-panel-id] {
  position: relative;
}
[data-panel-id]::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  z-index: 20;
}
[data-panel-id]:focus-within::after {
  border-color: rgba(59, 130, 246, 0.4);
}

/* Search highlight in Monaco editor */
.searchHighlight {
  background-color: rgba(255, 213, 0, 0.3);
  border: 1px solid rgba(255, 213, 0, 0.6);
  border-radius: 2px;
}

/* Disable all animations and transitions during E2E tests for stable screenshots */
.e2e-stable * {
  animation: none !important;
  animation-delay: 0s !important;
  animation-duration: 0s !important;
  transition: none !important;
  transition-delay: 0s !important;
  transition-duration: 0s !important;
}
/* Also disable caret blinking which causes screenshot diffs */
.e2e-stable textarea,
.e2e-stable input,
.e2e-stable [contenteditable] {
  caret-color: transparent !important;
}
/* Hide Monaco editor cursor for stable screenshots */
.e2e-stable .monaco-editor .cursor,
.e2e-stable .monaco-editor .cursors-layer {
  visibility: hidden !important;
}

/* Draggable region for window */
.titlebar-drag-region {
  -webkit-app-region: drag;
}

.titlebar-drag-region button,
.titlebar-drag-region input {
  -webkit-app-region: no-drag;
}
