/* Page-specific styles for the Pyodide IDE */

#ideMain {
  grid-template-columns: 1fr 8px 1fr;
}

#inputModal,
#fileInput {
  display: none;
}

.pyodide-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  color: white;
}

.loading-content {
  text-align: center;
  padding: 2rem;
  max-width: 400px;
}

.loading-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.loading-vorm-logo {
  height: 40px;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: loadingLogoGlow 2s ease-in-out infinite;
}

@keyframes loadingLogoGlow {
  0%, 100% {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 2px 20px rgba(255, 255, 255, 0.2), 0 0 15px rgba(76, 175, 80, 0.3);
    filter: brightness(1.1);
  }
}

.loading-logo-container h3 {
  margin: 0;
  font-size: 1.2rem;
  color: white;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #4CAF50;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-progress {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
  height: 8px;
  margin: 1rem 0;
}

.progress-bar {
  background: linear-gradient(90deg, #4CAF50, #2196F3);
  height: 100%;
  width: 0%;
  border-radius: 20px;
  transition: width 0.3s ease;
}

.pyodide-badge {
  background: linear-gradient(45deg, #FF6B35, #F7931E);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.pyodide-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 0.9rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.loading {
  background: #FFC107;
  animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.ready {
  background: #4CAF50;
}

.status-indicator.error {
  background: #f44336;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.ide-description {
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

#fontIncreaseBtn,
#fontDecreaseBtn,
#outputFontIncreaseBtn,
#outputFontDecreaseBtn {
  font-family: 'Fira Code', monospace;
  font-weight: bold;
  min-width: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  transition: all 0.2s ease;
}

#fontIncreaseBtn:hover,
#fontDecreaseBtn:hover,
#outputFontIncreaseBtn:hover,
#outputFontDecreaseBtn:hover {
  background: rgba(76, 175, 80, 0.2);
  border-color: #4CAF50;
  color: #4CAF50;
}

#fontIncreaseBtn:active,
#fontDecreaseBtn:active,
#outputFontIncreaseBtn:active,
#outputFontDecreaseBtn:active {
  background: rgba(76, 175, 80, 0.3);
  transform: scale(0.95);
}

.output-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trace-step-number {
  color: #4ec9b0;
  font-weight: normal;
  margin-right: 0.75rem;
  min-width: 2rem;
  flex-shrink: 0;
  text-align: right;
  font-family: 'Fira Code', monospace;
}

.trace-line {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.4rem;
  padding: 0.2rem 0;
  word-break: break-word;
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  line-height: 1.4;
}

.trace-text {
  color: #ffffff;
  flex: 1;
  font-weight: normal;
}

.trace-line:has(.trace-text:contains("--- Execution Trace ---")),
.trace-line:has(.trace-text:contains("--- End Trace ---")) {
  background: rgba(76, 175, 80, 0.1);
  border-left: 3px solid #4ec9b0;
  padding-left: 0.5rem;
  margin: 0.25rem 0;
}

.trace-line:has(.trace-text:contains("Line ")) {
  background: rgba(255, 255, 255, 0.02);
  padding-left: 0.5rem;
  font-family: 'Fira Code', monospace;
  font-size: 12px;
}

.pyodide-ready .pyodide-loading-overlay {
  display: none;
}

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

.vorm-logo {
  height: 48px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.vorm-logo:hover {
  transform: scale(1.05);
}

.header-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.header-text h1 {
  margin: 0;
  font-size: 1.5rem;
}

.header-text p {
  margin: 0;
}

.mode-toggle-container {
  display: inline-block;
  margin-left: 1rem;
}

.toggle-slider {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #444, #222);
  border-radius: 20px;
  padding: 0.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  width: 120px;
  height: 32px;
}

.toggle-slider:hover {
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.slider-label {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Fira Code', monospace;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
  z-index: 2;
  position: relative;
}

.slider-label.active {
  color: white;
}

.slider-handle {
  position: absolute;
  top: 2px;
  width: 56px;
  height: 28px;
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  border-radius: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-slider.chill-active .slider-handle {
  left: 2px;
}

.toggle-slider.dark-active .slider-handle {
  right: 2px;
}

.chill-mode {
  filter: brightness(0.7);
}

.chill-mode .status-bar {
  background: linear-gradient(135deg, #2d2d44, #1a1a2e);
}

.output-panel .panel-title {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #4CAF50;
  text-shadow: 0 0 2px rgba(76, 175, 80, 0.2);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.output-panel.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10000 !important;
  background: #000 !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.output-panel.fullscreen .output-container {
  height: calc(100vh - 40px) !important;
  border-radius: 0 !important;
  border: none !important;
}

.output-panel.fullscreen .panel-header {
  border-radius: 0 !important;
  border-bottom: 1px solid #333 !important;
}

.output-panel.fullscreen #fullscreenToggleBtn::after {
  content: "⛶" !important;
}

.output-panel,
.editor-panel {
  transition: all 0.3s ease-in-out;
}

body.fullscreen-active .main-container > *:not(.output-panel.fullscreen) {
  display: none !important;
}

body.fullscreen-active .output-panel.fullscreen {
  display: block !important;
}

.editor-panel.editor-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10000 !important;
  background: #1a1a1a !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.editor-panel.editor-fullscreen .editor-container {
  height: calc(100vh - 40px) !important;
  border-radius: 0 !important;
  border: none !important;
}

.editor-panel.editor-fullscreen .panel-header {
  border-radius: 0 !important;
  border-bottom: 1px solid #333 !important;
}

.editor-panel.editor-fullscreen #editorFullscreenBtn::after {
  content: "⛶" !important;
}

body.editor-fullscreen-active .main-container > *:not(.editor-panel.editor-fullscreen) {
  display: none !important;
}

body.editor-fullscreen-active .editor-panel.editor-fullscreen {
  display: block !important;
}

.output-container.crt-orange {
  background: linear-gradient(135deg, #1a0f00 0%, #0f0800 50%, #1a0f00 100%);
  border: 2px solid #ff6600;
  box-shadow:
    inset 0 0 20px rgba(255, 102, 0, 0.2),
    0 0 30px rgba(255, 102, 0, 0.3);
}

.output-container.crt-orange::before {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 102, 0, 0.05) 2px,
      rgba(255, 102, 0, 0.05) 4px
    );
}

.output-container.crt-orange::after {
  background: rgba(255, 102, 0, 0.05);
}

.output-container.crt-orange #output {
  color: #ff8833;
  text-shadow: 0 0 2px rgba(255, 102, 0, 0.4);
}

.output-container.crt-orange .output-system {
  color: #ffaa55 !important;
  text-shadow: 0 0 2px rgba(255, 170, 85, 0.3) !important;
}

.output-container.crt-orange .output-error {
  color: #ff4444 !important;
  text-shadow: 0 0 8px rgba(255, 68, 68, 0.6) !important;
}

.output-container.crt-orange .output-success {
  color: #ffcc66 !important;
  text-shadow: 0 0 8px rgba(255, 204, 102, 0.6) !important;
}

.output-panel.crt-orange .panel-title {
  color: #ff8833 !important;
  text-shadow: 0 0 5px rgba(255, 136, 51, 0.5) !important;
}
