/* ===== DESIGN TOKENS ===== */
:root {
  /* Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #1a1a28;
  --bg-card-hover: #22223a;
  --bg-elevated: #242438;
  --bg-input: #0e0e18;

  --text-primary: #f0f0f5;
  --text-secondary: #9898b0;
  --text-muted: #5a5a78;

  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --accent-glow: rgba(108, 92, 231, 0.3);

  --success: #00e676;
  --success-bg: rgba(0, 230, 118, 0.08);
  --success-border: rgba(0, 230, 118, 0.25);

  --error: #ff5252;
  --error-bg: rgba(255, 82, 82, 0.08);
  --error-border: rgba(255, 82, 82, 0.25);

  --warning: #ffab40;
  --warning-bg: rgba(255, 171, 64, 0.08);

  --easy: #00e676;
  --medium: #ffab40;
  --hard: #ff5252;

  --border: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
}

/* ===== SCREENS ===== */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

/* ===== PARTICLES BACKGROUND ===== */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: floatParticle linear infinite;
}

@keyframes floatParticle {
  0% {
    opacity: 0;
    transform: translateY(100vh) scale(0);
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    opacity: 0;
    transform: translateY(-10vh) scale(1);
  }
}

/* ===== WELCOME SCREEN ===== */
#welcome-screen {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  background:
    radial-gradient(
      ellipse at 20% 50%,
      rgba(108, 92, 231, 0.08) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 20%,
      rgba(162, 155, 254, 0.05) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 80%,
      rgba(108, 92, 231, 0.04) 0%,
      transparent 50%
    ),
    var(--bg-primary);
}

.welcome-container {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  width: 100%;
  animation: fadeInUp 0.8s ease-out;
}

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

/* Logo */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.logo-icon {
  color: var(--accent-light);
  animation: pulse 3s ease-in-out infinite;
}

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

.logo-text {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-subtitle {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.welcome-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 3rem;
  line-height: 1.7;
}

/* Level Selector */
.level-selector {
  margin-bottom: 3rem;
}

.level-title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.level-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.level-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.level-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.level-card[data-level="facil"]::before {
  background: linear-gradient(90deg, transparent, var(--easy), transparent);
}

.level-card[data-level="medio"]::before {
  background: linear-gradient(90deg, transparent, var(--medium), transparent);
}

.level-card[data-level="dificil"]::before {
  background: linear-gradient(90deg, transparent, var(--hard), transparent);
}

.level-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.level-card:hover::before {
  opacity: 1;
}

.level-card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.level-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.level-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.level-tag {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.tag-easy {
  background: rgba(0, 230, 118, 0.1);
  color: var(--easy);
  border: 1px solid rgba(0, 230, 118, 0.2);
}

.tag-medium {
  background: rgba(255, 171, 64, 0.1);
  color: var(--medium);
  border: 1px solid rgba(255, 171, 64, 0.2);
}

.tag-hard {
  background: rgba(255, 82, 82, 0.1);
  color: var(--hard);
  border: 1px solid rgba(255, 82, 82, 0.2);
}

/* Stats Bar */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.25rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(10px);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border-light);
}

/* ===== CHALLENGE SCREEN ===== */
#challenge-screen {
  flex-direction: column;
  background: var(--bg-primary);
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: 56px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.back-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.header-brand {
  display: flex;
  align-items: center;
}

.header-logo {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.level-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.level-badge.level-facil {
  border-color: rgba(0, 230, 118, 0.3);
}

.level-badge.level-facil .level-dot {
  background: var(--easy);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

.level-badge.level-medio {
  border-color: rgba(255, 171, 64, 0.3);
}

.level-badge.level-medio .level-dot {
  background: var(--medium);
  box-shadow: 0 0 8px rgba(255, 171, 64, 0.5);
}

.level-badge.level-dificil {
  border-color: rgba(255, 82, 82, 0.3);
}

.level-badge.level-dificil .level-dot {
  background: var(--hard);
  box-shadow: 0 0 8px rgba(255, 82, 82, 0.5);
}

.level-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.challenge-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
}

.streak-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-light);
}

.streak-indicator svg {
  color: var(--accent-light);
}

/* Challenge Layout */
.challenge-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow: hidden;
}

/* Challenge Panel */
.challenge-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 40px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.5rem 0;
}

.panel-tab.active {
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
}

.editor-lang {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Challenge Content */
.challenge-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.challenge-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.challenge-content .challenge-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.challenge-content .example-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.challenge-content .example-box h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  margin-bottom: 0.75rem;
}

.challenge-content .example-box pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.challenge-content .hint-tag {
  display: inline-block;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 171, 64, 0.15);
  margin-top: 0.5rem;
}

/* Challenge Actions */
.challenge-actions {
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Solution Panel */
.solution-panel {
  padding: 1rem 1.5rem;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  max-height: 300px;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

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

.solution-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-light);
}

.solution-close {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: all var(--transition-fast);
}

.solution-close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.solution-code {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  overflow-x: auto;
}

.solution-code code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre;
}

.solution-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.75rem;
}

/* Editor Panel */
.editor-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.editor-wrapper .CodeMirror {
  height: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
}

.editor-actions {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Console */
.console-panel {
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  max-height: 200px;
}

.console-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.console-output {
  padding: 0.75rem 1rem;
  max-height: 150px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  background: var(--bg-input);
}

.console-placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.console-line {
  padding: 0.1rem 0;
}

.console-line.log {
  color: var(--text-secondary);
}

.console-line.error {
  color: var(--error);
}

.console-line.success {
  color: var(--success);
}

.console-line.info {
  color: var(--accent-light);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5a4bd1);
  color: white;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.btn-success {
  background: linear-gradient(135deg, #00c853, #00e676);
  color: #0a0a0f;
  font-weight: 700;
}

.btn-success:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 230, 118, 0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #ff8f00, #ffab40);
  color: #0a0a0f;
  font-weight: 700;
}

.btn-warning:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, #d32f2f, #ff5252);
  color: white;
  font-weight: 700;
}

.btn-danger:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.25s ease-out;
  padding: 1rem;
}

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

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: center;
  max-width: 460px;
  width: 100%;
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.modal-message {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.modal-details {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.modal-details .detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
}

.modal-details .detail-label {
  color: var(--text-muted);
}

.modal-details .detail-value {
  font-weight: 700;
  color: var(--text-primary);
}

.modal-details .detail-dropdown {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.15rem;
}

.modal-details .detail-dropdown summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.modal-details .detail-dropdown summary::-webkit-details-marker {
  display: none;
}

.modal-details .detail-dropdown summary .detail-label::before {
  content: '▶';
  display: inline-block;
  margin-right: 0.4rem;
  font-size: 0.65rem;
  transition: transform 0.2s ease;
  vertical-align: middle;
}

.modal-details .detail-dropdown[open] summary .detail-label::before {
  transform: rotate(90deg);
}

.modal-details .test-results-list {
  padding: 0.4rem 0 0.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.modal-details .test-result-item {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: 'Fira Code', monospace;
}

.modal-details .test-result-item.test-pass {
  background: rgba(0, 230, 118, 0.08);
}

.modal-details .test-result-item.test-fail {
  background: rgba(255, 82, 82, 0.08);
}

.modal-details .test-result-item .test-expected {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-actions .btn {
  flex: 1;
  min-width: 140px;
  justify-content: center;
  padding: 0.75rem 1.5rem;
}

/* ===== HIDDEN UTILITY ===== */
.hidden {
  display: none !important;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .level-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .challenge-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }

  .challenge-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .stats-bar {
    padding: 1rem 1.5rem;
    gap: 1.25rem;
  }

  .logo-text {
    font-size: 2.25rem;
  }

  .modal-card {
    padding: 1.75rem;
  }
}

@media (max-width: 600px) {
  #welcome-screen {
    padding: 1rem;
  }

  .welcome-container {
    padding: 0 0.5rem;
  }

  .logo-container {
    flex-direction: column;
    gap: 0.5rem;
  }

  .logo-text {
    font-size: 2rem;
  }

  .level-card {
    padding: 1.5rem 1rem;
  }

  .stats-bar {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .stat-divider {
    width: 40px;
    height: 1px;
  }

  .app-header {
    padding: 0.5rem 0.75rem;
  }

  .header-logo {
    font-size: 0.9rem;
  }

  .header-center {
    gap: 0.5rem;
  }

  .level-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
  }

  .challenge-counter {
    display: none;
  }

  .challenge-content {
    padding: 1rem;
  }

  .editor-actions {
    flex-direction: column;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    min-width: unset;
  }
}

/* ===== CODEMIRROR OVERRIDES ===== */
.CodeMirror {
  background: var(--bg-input) !important;
}

.cm-s-dracula .CodeMirror-gutters {
  background: var(--bg-secondary) !important;
  border-right-color: var(--border) !important;
}

.cm-s-dracula .CodeMirror-linenumber {
  color: var(--text-muted) !important;
}

.cm-s-dracula .CodeMirror-cursor {
  border-left-color: var(--accent-light) !important;
}

.CodeMirror-selected {
  background: rgba(108, 92, 231, 0.2) !important;
}

.cm-s-dracula .CodeMirror-activeline-background {
  background: rgba(255, 255, 255, 0.03) !important;
}

/* ===== LOADING ANIMATION ===== */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}
