/* Custom scrollbar styles */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
/* Light theme scrollbar */
::-webkit-scrollbar-track {
  background: #e5e7eb;
}
::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}
/* Dark theme scrollbar */
.dark ::-webkit-scrollbar-track {
  background: #1f2937;
}
.dark ::-webkit-scrollbar-thumb {
  background: #4b5563;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Hide scrollbar for the tabs container */
#tabs-container::-webkit-scrollbar {
  display: none;
}
/* Simple splitter styling */
.splitter {
  flex: 0 0 5px;
  cursor: col-resize;
  z-index: 10;
}
/* Prevents text selection during UI interactions */
.select-none {
  user-select: none;
}
/* Custom checkbox style */
input[type="checkbox"] {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  display: grid;
  place-content: center;
  cursor: pointer;
}
input[type="checkbox"]::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em #3b82f6;
  transform-origin: bottom left;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type="checkbox"]:checked::before {
  transform: scale(1);
}
/* CodeMirror styles */
.CodeMirror {
  height: 100%;
  font-size: 14px;
  border-radius: 0.375rem;
}
.CodeMirror-placeholder {
  color: #9ca3af !important;
}
.dark .CodeMirror-placeholder {
  color: #6b7280 !important;
}

.tab-dragging {
  opacity: 0.5;
}

.tab-drag-over {
  box-shadow: inset 0 -3px rgba(59, 130, 246, 0.85);
}

.tab-drag-handle {
  cursor: grab;
  font-size: 0.9rem;
}

.tab-drag-handle:active {
  cursor: grabbing;
}

[data-tab-id]:hover .tab-drag-handle {
  color: #3b82f6 !important;
}

#open-file-button,
#clear-input-button,
#theme-toggle-button,
#settings-button,
#copy-button,
#save-button,
#bulk-save-button {
  transition: background-color 0.15s ease, color 0.15s ease;
}

#open-file-button:hover,
#clear-input-button:hover,
#theme-toggle-button:hover,
#settings-button:hover,
#copy-button:hover,
#save-button:hover,
#bulk-save-button:hover {
  color: #1d4ed8;
  background-color: rgba(59, 130, 246, 0.15);
}

.dark #open-file-button:hover,
.dark #clear-input-button:hover,
.dark #theme-toggle-button:hover,
.dark #settings-button:hover,
.dark #copy-button:hover,
.dark #save-button:hover,
.dark #bulk-save-button:hover {
  color: #93c5fd;
  background-color: rgba(59, 130, 246, 0.25);
}

.editor-frame {
  border: 1px solid #93c5fd;
  box-sizing: border-box;
}

.dark .editor-frame {
  border-color: #93c5fd;
}

.editor-frame.drag-over {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.dark .editor-frame.drag-over {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.35);
}

@media (max-width: 767px) {
  /* Ensure stacked editors stay readable on phones and grow if space allows */
  #input-editor-wrapper,
  #output-editor {
    min-height: clamp(calc(10 * 1.5rem), 45vh, 32rem);
  }
}

.settings-tabs {
  display: flex;
  gap: 0.5rem;
}

.settings-tab-button {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 600;
  color: #4b5563;
  background-color: transparent;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
}

.dark .settings-tab-button {
  color: #d1d5db;
}

.settings-tab-button.active {
  background-color: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.4);
}

.dark .settings-tab-button.active {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.6);
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

#input-loading-overlay {
  transition: opacity 0.15s ease;
}

.loading-spinner {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  border: 4px solid rgba(59, 130, 246, 0.25);
  border-top-color: #3b82f6;
  animation: input-spinner-rotate 0.9s linear infinite;
}

@keyframes input-spinner-rotate {
  to {
    transform: rotate(360deg);
  }
}
