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

#inputModal,
#fileInput {
  display: none;
}

.pyodide-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, var(--bg), var(--panel));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  color: var(--text);
}

.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(79, 209, 197, 0.25), 0 0 15px rgba(79, 209, 197, 0.3);
    filter: brightness(1.1);
  }
}

.loading-logo-container h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--text);
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border);
  border-left: 4px solid var(--net);
  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: var(--panel-alt);
  border-radius: 20px;
  overflow: hidden;
  height: 8px;
  margin: 1rem 0;
}

.progress-bar {
  background: linear-gradient(90deg, var(--net), var(--blue));
  height: 100%;
  width: 0%;
  border-radius: 20px;
  transition: width 0.3s ease;
}

.pyodide-badge {
  background: linear-gradient(45deg, var(--host), #F7C68C);
  color: var(--bg);
  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: var(--panel-alt);
  border-radius: 6px;
  font-size: 0.9rem;
}

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

.status-indicator.loading {
  background: var(--host);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.ready {
  background: var(--green);
}

.status-indicator.error {
  background: var(--danger);
}

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

.ide-description {
  margin: 0.5rem 0 0 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  font-weight: 400;
}

#fontIncreaseBtn,
#fontDecreaseBtn,
#outputFontIncreaseBtn,
#outputFontDecreaseBtn {
  font-family: var(--display);
  font-weight: bold;
  min-width: 32px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.2s ease;
}

#fontIncreaseBtn:hover,
#fontDecreaseBtn:hover,
#outputFontIncreaseBtn:hover,
#outputFontDecreaseBtn:hover {
  background: var(--net-dim);
  border-color: var(--net);
  color: var(--net);
}

#fontIncreaseBtn:active,
#fontDecreaseBtn:active,
#outputFontIncreaseBtn:active,
#outputFontDecreaseBtn:active {
  background: var(--net-dim);
  transform: scale(0.95);
}

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

.trace-step-number {
  color: var(--net);
  font-weight: normal;
  margin-right: 0.75rem;
  min-width: 2rem;
  flex-shrink: 0;
  text-align: right;
  font-family: var(--mono);
}

.trace-line {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.4rem;
  padding: 0.2rem 0;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
}

.trace-text {
  color: var(--text);
  flex: 1;
  font-weight: normal;
}

.trace-line:has(.trace-text:contains("--- Execution Trace ---")),
.trace-line:has(.trace-text:contains("--- End Trace ---")) {
  background: var(--net-dim);
  border-left: 3px solid var(--net);
  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: var(--mono);
  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-family: var(--display);
  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, var(--panel-alt), var(--bg));
  border-radius: 20px;
  padding: 0.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  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: var(--mono);
  color: var(--text-dim);
  transition: all 0.3s ease;
  z-index: 2;
  position: relative;
}

.slider-label.active {
  color: var(--text);
}

.slider-handle {
  position: absolute;
  top: 2px;
  width: 56px;
  height: 28px;
  background: linear-gradient(135deg, var(--net), var(--net-dim));
  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);
}

/* Output panel header — kept CRT-green, not house-style, since it's the
   bezel/label directly around the CRT output element in python-ide-simple.css
   (this rule already overrides that file's version for .panel-title, same
   as before this refresh — only the values were left as they were). */
.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: var(--bg) !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 var(--border) !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: var(--bg) !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 var(--border) !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;
}
