/* VS CODE-LIKE IDE STYLES */

/* IDE Container - Full Screen Layout */
.ide-container {
  --sidebar-width: 240px;
  --sidebar-min-width: 160px;
  --sidebar-max-width: 420px;
  --panel-width: 360px;
  --panel-min-width: 260px;
  --panel-max-width: 520px;
  --shell-padding: clamp(16px, 3.5vw, 36px);
  --surface-primary: rgba(26, 14, 52, 0.78);
  --surface-secondary: rgba(10, 10, 26, 0.72);
  --surface-tertiary: rgba(40, 12, 72, 0.82);
  --surface-border: rgba(255, 255, 255, 0.14);
  --surface-border-strong: rgba(255, 255, 255, 0.24);
  --accent: var(--unicorn-purple);
  --accent-strong: var(--unicorn-blue);
  --success: var(--unicorn-mint);
  --text-primary: #f5f5ff;
  --text-muted: rgba(226, 232, 255, 0.75);
  --glow-gradient: linear-gradient(135deg, rgba(255, 107, 157, 0.22), rgba(196, 76, 255, 0.24), rgba(77, 166, 255, 0.28));
  --glow-accent: linear-gradient(135deg, rgba(255, 107, 157, 0.85), rgba(77, 166, 255, 0.9));
  --glass-highlight: rgba(255, 255, 255, 0.08);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(140deg, rgba(8, 2, 20, 0.96), rgba(2, 6, 26, 0.96)), var(--cosmic-gradient);
  color: var(--text-primary);
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  padding: var(--shell-padding);
  gap: clamp(12px, 2vw, 20px);
  box-sizing: border-box;
  z-index: 1000;
  overflow: hidden;
}

/* Title Bar */
.title-bar {
  min-height: 64px;
  background: var(--glow-gradient);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 3vw, 28px);
  font-size: 13px;
  user-select: none;
  gap: 20px;
  flex-wrap: nowrap;
  overflow: hidden;
  backdrop-filter: blur(26px);
  box-shadow: 0 30px 60px -32px rgba(196, 76, 255, 0.65), 0 18px 45px -28px rgba(77, 166, 255, 0.35);
  position: relative;
}

.title-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.24), transparent 60%);
  opacity: 0.2;
  pointer-events: none;
}

.title-bar-left {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
  color: var(--text-primary);
}

.title-bar-right {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
  color: var(--text-primary);
}

.home-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.85), rgba(77, 166, 255, 0.85));
  transition: all 0.25s ease;
  text-decoration: none;
}

.home-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px -18px rgba(196, 76, 255, 0.65), 0 10px 26px -16px rgba(77, 166, 255, 0.55);
}

.title-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
}

.title-text span:first-child {
  position: relative;
  font-weight: 700;
  font-size: 16px;
  background: var(--unicorn-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.01em;
  display: inline-block;
}

.title-text span:first-child::after {
  content: '';
  position: absolute;
  inset: -12px -16px;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.25), transparent 70%);
  z-index: -1;
  filter: blur(22px);
  opacity: 0.9;
}

.difficulty-badge-small {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--glow-gradient);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.breadcrumb .separator {
  opacity: 0.6;
}

.project-stats {
  display: flex;
  gap: 15px;
  font-size: 12px;
  opacity: 0.8;
  align-items: center;
  white-space: nowrap;
}

/* Main IDE Layout */
.ide-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
  background: var(--surface-secondary);
  border: 1px solid var(--surface-border);
  border-radius: 26px;
  backdrop-filter: blur(24px);
  box-shadow: 0 35px 80px -60px rgba(8, 47, 73, 0.85), 0 25px 60px -45px rgba(15, 118, 110, 0.35);
}

/* Sidebar */
.sidebar {
  display: flex;
  background: linear-gradient(160deg, rgba(24, 10, 52, 0.82), rgba(8, 12, 32, 0.82));
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  width: var(--sidebar-width);
  min-width: var(--sidebar-min-width);
  max-width: var(--sidebar-max-width);
  flex-shrink: 0;
  backdrop-filter: blur(22px);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.workspace {
  flex: 1;
  display: flex;
  min-width: 0;
  min-height: 0;
}

/* Activity Bar */
.activity-bar {
  width: 48px;
  background: rgba(148, 163, 184, 0.04);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.activity-item {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(148, 163, 184, 0.75);
  transition: all 0.2s;
  position: relative;
}

.activity-item:hover {
  color: var(--text-primary);
}

.activity-item.active {
  color: #f8fafc;
}

.activity-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
}

/* Side Panel */
.side-panel {
  flex: 1;
  background: transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
}

.panel-content {
  flex: 1;
  overflow: hidden;
  display: none;
}

.panel-content:not(.hidden) {
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel-actions {
  display: flex;
  gap: 4px;
}

.panel-btn {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  color: rgba(148, 163, 184, 0.75);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.25s ease;
}

.panel-btn:hover {
  background: rgba(255, 107, 157, 0.22);
  border-color: rgba(196, 76, 255, 0.28);
  color: #ffffff;
}

/* File Tree */
.file-tree {
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 16px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.25s ease;
  color: var(--text-muted);
  border-radius: 12px;
  margin: 0 8px;
}

.file-item:hover {
  background: rgba(255, 107, 157, 0.18);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.file-item.active {
  background: var(--glow-gradient);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 12px 32px -18px rgba(196, 76, 255, 0.6);
}

/* Editor Area */
.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(6, 14, 26, 0.78);
  backdrop-filter: blur(20px);
  min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Tab Bar */
.tab-bar {
  height: 42px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  backdrop-filter: blur(18px);
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: transparent;
  border-right: 1px solid rgba(148, 163, 184, 0.08);
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 13px;
  white-space: nowrap;
  position: relative;
  color: var(--text-muted);
}

.tab.tab-terminal {
  display: none;
}

.tab:hover {
  background: rgba(196, 76, 255, 0.14);
  color: #ffffff;
}

.tab.active {
  background: var(--glow-gradient);
  color: #ffffff;
  border-bottom: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.tab-close {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  border-radius: 3px;
  font-size: 14px;
  margin-left: 4px;
  opacity: 0;
  transition: all 0.25s ease;
}

.tab:hover .tab-close {
  opacity: 1;
}

.tab-close:hover {
  background: rgba(255, 107, 157, 0.26);
  border-color: rgba(196, 76, 255, 0.35);
  color: #ffffff;
}

/* Editor Content */
.editor-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 28px;
}

.mobile-terminal-host {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.mobile-terminal-host .terminal-view.active {
  pointer-events: auto;
}

.editor-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
}

.editor-view.active {
  display: block;
}

.editor-view[data-file="README.md"] {
  background: transparent;
  padding: 24px;
  overflow: auto;
}

.readme-content {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 0 32px 0;
  box-shadow: none;
  color: var(--text-primary);
  backdrop-filter: blur(20px);
  max-height: 100%;
  overflow-y: auto;
}

.readme-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #f8fafc;
}

.readme-body {
  font-size: 15px;
  line-height: 1.7;
  color: rgba(229, 231, 255, 0.82);
}

.readme-body pre,
.readme-body code {
  background: rgba(22, 10, 44, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  color: #f3f4ff;
}

.readme-body pre {
  padding: 16px;
  margin: 18px 0;
}

.readme-body code {
  padding: 2px 6px;
}

#monaco-editor {
  background: linear-gradient(160deg, rgba(18, 8, 44, 0.9), rgba(4, 8, 24, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

#test-input {
  background: rgba(12, 8, 32, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 18px !important;
  color: var(--text-primary) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#test-input-editor textarea {
  background: rgba(6, 12, 24, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  border-radius: 12px;
  padding: 16px;
}

/* Right Panel */
.right-panel {
  flex: 0 0 var(--panel-width);
  width: var(--panel-width);
  min-width: var(--panel-min-width);
  max-width: var(--panel-max-width);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(160deg, rgba(18, 8, 40, 0.78), rgba(6, 10, 28, 0.92));
  border-radius: 26px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 0 30px 70px -50px rgba(8, 47, 73, 0.8);
  display: flex;
  flex-direction: column;
  min-height: 0;
}


.vertical-resizer {
  width: 8px;
  cursor: col-resize;
  background: rgba(148, 163, 184, 0.08);
  border-top: none;
  border-bottom: none;
  border-left: 1px solid rgba(148, 163, 184, 0.1);
  border-right: 1px solid rgba(148, 163, 184, 0.1);
  flex-shrink: 0;
  border-radius: 999px;
  min-height: 0;
  position: relative;
}

.vertical-resizer::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 44px;
  background: rgba(148, 163, 184, 0.25);
  transform: translate(-50%, -50%);
  border-radius: 1px;
}

.vertical-resizer:hover,
.vertical-resizer.active {
  background: rgba(56, 189, 248, 0.25);
}

body.resizing {
  user-select: none;
}

/* Status Bar */
.status-bar {
  height: 22px;
  background: #007acc;
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 12px;
}

.status-left,
.status-right {
  display: flex;
  gap: 12px;
}

.status-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.status-item {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background 0.2s;
}

.status-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: var(--glow-accent);
  color: #f8fafc;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.25s ease;
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px -26px rgba(14, 165, 233, 0.6);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 46px -24px rgba(196, 76, 255, 0.8), 0 18px 40px -26px rgba(77, 166, 255, 0.65);
}

.action-btn.primary {
  background: linear-gradient(135deg, rgba(196, 76, 255, 0.85), rgba(77, 166, 255, 0.9));
}

.action-btn.primary:hover {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.85), rgba(77, 166, 255, 0.95));
}

.action-btn.success {
  background: linear-gradient(135deg, rgba(77, 255, 166, 0.75), rgba(77, 216, 218, 0.85));
}

.action-btn.success:hover {
  background: linear-gradient(135deg, rgba(77, 255, 166, 0.9), rgba(77, 216, 218, 0.95));
}

/* Terminal Panel - Sidebar Layout */
.terminal-layout {
  height: 100%;
  background: transparent;
  display: flex;
  flex: 1;
}

.terminal-sidebar {
  width: 60px;
  background: rgba(255, 255, 255, 0.05);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 4px;
  min-height: 0;
  backdrop-filter: blur(18px);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.terminal-nav-item {
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  color: rgba(226, 232, 255, 0.75);
  transition: all 0.25s ease;
  text-decoration: none;
}

.terminal-nav-item:hover {
  background: rgba(255, 107, 157, 0.22);
  color: #ffffff;
  box-shadow: 0 14px 32px -24px rgba(196, 76, 255, 0.6);
}

.terminal-nav-item.active {
  background: var(--glow-accent);
  color: #ffffff;
  box-shadow: 0 20px 40px -24px rgba(196, 76, 255, 0.75);
}

.terminal-nav-item svg {
  width: 16px;
  height: 16px;
}

.terminal-nav-item span {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1;
}

.terminal-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(8, 6, 20, 0.88), rgba(4, 6, 18, 0.92));
  backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.terminal-view {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
}

.terminal-view.active {
  display: flex;
}

.terminal-header {
  height: 30px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(226, 232, 255, 0.7);
}

.terminal-body {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(245, 245, 255, 0.95);
  white-space: pre-wrap;
  word-wrap: break-word;
  background: linear-gradient(160deg, rgba(20, 12, 40, 0.8), rgba(8, 10, 28, 0.92));
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 18px 45px -32px rgba(196, 76, 255, 0.35);
  position: relative;
}

.terminal-body.terminal-loading-active {
  padding: 0;
  display: flex;
  align-items: stretch;
}

.terminal-body.terminal-loading-active .terminal-loading {
  flex: 1;
  margin: 0;
  width: 100%;
  height: 100%;
}

.terminal-output-block {
  margin-top: 0.75rem;
  background: rgba(14, 18, 38, 0.95);
  color: #f8f9ff;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.terminal-warning-block {
  margin-top: 0.75rem;
  background: rgba(255, 214, 102, 0.18);
  color: #fffbeb;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(255, 214, 102, 0.4);
}

.terminal-error-block {
  margin-top: 0.75rem;
  background: rgba(239, 68, 68, 0.18);
  color: #ffe4e6;
  padding: 1rem 1.25rem;
  border-radius: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.terminal-placeholder {
  font-size: 0.9rem;
  color: rgba(226, 232, 255, 0.78);
  font-style: italic;
}

.terminal-placeholder-hint {
  font-size: 0.9rem;
  color: rgba(226, 232, 255, 0.78);
  font-style: italic;
}

.terminal-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(32, 14, 68, 0.75), rgba(12, 10, 36, 0.85));
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: 1rem;
  color: rgba(245, 248, 255, 0.96);
}

.terminal-summary.pass {
  border-left: 3px solid #4ade80;
}

.terminal-summary.fail {
  border-left: 3px solid #f87171;
}

.terminal-summary.neutral {
  border-left: 3px solid rgba(148, 163, 184, 0.35);
}

.terminal-summary.neutral .terminal-summary-badge {
  color: rgba(226, 232, 255, 0.82);
}

.terminal-summary.neutral .terminal-summary-count {
  color: rgba(148, 163, 184, 0.65);
}

.terminal-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.terminal-summary-count {
  font-size: 0.85rem;
  color: rgba(226, 232, 255, 0.7);
  font-weight: 500;
}

.terminal-test-card {
  margin-bottom: 12px;
  border-radius: 14px;
  padding: 14px 18px;
  background: rgba(24, 14, 50, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.terminal-test-card.pass {
  border-left: 4px solid #4ade80;
  background: rgba(34, 197, 94, 0.08);
}

.terminal-test-card.fail {
  border-left: 4px solid #f87171;
  background: rgba(239, 68, 68, 0.08);
}

.terminal-test-card.neutral {
  border-left: 4px solid rgba(148, 163, 184, 0.45);
}

.terminal-test-card.warning {
  border-left: 4px solid #facc15;
  background: rgba(250, 204, 21, 0.08);
}

.terminal-test-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(245, 248, 255, 0.96);
}

.terminal-test-card-body {
  margin-top: 10px;
  font-size: 0.9rem;
  color: rgba(236, 239, 255, 0.88);
  line-height: 1.6;
}

.terminal-test-card-body div {
  margin-bottom: 6px;
}

.terminal-log-pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  white-space: pre-wrap;
  word-break: break-word;
  color: inherit;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(12px);
}

.modal-content {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 45px 90px -60px rgba(8, 47, 73, 0.95);
  overflow: hidden;
}

.modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  color: #f1f5f9;
  font-size: 19px;
  font-weight: 600;
}

.modal-close {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid transparent;
  color: rgba(226, 232, 240, 0.8);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.25s ease;
}

.modal-close:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #f8fafc;
}

.modal-body {
  padding: 28px;
  text-align: center;
}

.warning-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.modal-body p {
  margin: 0 0 16px 0;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
}

.warning-text {
  color: #ff6b6b !important;
  font-size: 14px !important;
  font-weight: 500;
}

.modal-footer {
  padding: 0 28px 28px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s ease;
  min-width: 80px;
}

.modal-btn.secondary {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-primary);
}

.modal-btn.secondary:hover {
  background: rgba(148, 163, 184, 0.22);
}

.modal-btn.danger {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.75), rgba(239, 68, 68, 0.95));
  color: #fff5f5;
}

.modal-btn.danger:hover {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.9), rgba(239, 68, 68, 1));
}

/* IDE Navigation */
.ide-navigation {
  position: absolute;
  bottom: calc(var(--shell-padding) + 32px);
  left: calc(var(--shell-padding) + 12px);
  right: calc(var(--shell-padding) + var(--panel-width) + 32px);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.26), rgba(196, 76, 255, 0.32), rgba(77, 166, 255, 0.32));
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #f8fafc;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s;
  pointer-events: auto;
}

.nav-btn:hover {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.4), rgba(196, 76, 255, 0.45), rgba(77, 166, 255, 0.45));
  transform: translateY(-3px);
  box-shadow: 0 26px 60px -36px rgba(196, 76, 255, 0.65);
}


/* Sidebar Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .breadcrumb {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .ide-container {
    --shell-padding: 0;
    padding: 0;
    gap: 0;
  }

  .title-bar,
  .ide-main,
  .right-panel {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .title-bar {
    margin: 0;
    border-top: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .vertical-resizer {
    display: none;
  }

  /* Hide sidebar but keep file tabs on mobile */
  .sidebar {
    display: none !important;
  }

  /* Make file tabs compact for mobile */
  .tab-bar {
    height: 40px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    height: 40px;
    min-width: 80px;
    max-width: 120px;
    font-size: 12px;
    padding: 0 10px;
    flex-shrink: 0;
  }

  .tab-close {
    display: none; /* Hide close buttons on mobile */
  }

  .tab.tab-terminal {
    display: flex;
  }

  /* Title Bar - Compact for mobile */
  .title-bar {
    min-height: 50px;
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: wrap;
  }

  .title-bar-left {
    gap: 8px;
  }

  .title-bar-right {
    gap: 6px;
  }

  .title-text {
    font-size: 13px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .project-stats {
    display: none;
  }

  .workspace {
    flex-direction: column;
  }

  .right-panel {
    display: none;
  }

  .mobile-terminal-host {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    pointer-events: none;
  }

  .mobile-terminal-host .terminal-view.active {
    pointer-events: auto;
  }

  .terminal-layout {
    display: none;
  }

  /* Hide bottom terminal tabs on mobile; use editor tabs instead */
  .terminal-sidebar,
  .terminal-nav-item {
    display: none !important;
  }

  .terminal-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    background: transparent;
    pointer-events: none;
  }

  .terminal-view.active {
    display: flex;
    pointer-events: auto;
  }

  .terminal-header {
    display: none;
  }

  .terminal-body {
    flex: 1;
    font-size: 13px;
    line-height: 1.7;
    padding: 18px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    border: none;
    border-radius: 22px;
    background: linear-gradient(160deg, rgba(18, 8, 44, 0.9), rgba(4, 8, 24, 0.95));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  .terminal-body * {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }

  .tab[data-file="notes.txt"],
  .file-item[data-file="notes.txt"],
  .editor-view[data-file="notes.txt"] {
    display: none !important;
  }

  /* Hide notes tab/items on mobile */
  .tab[data-file="notes.txt"],
  .file-item[data-file="notes.txt"],
  .editor-view[data-file="notes.txt"] {
    display: none !important;
  }

  /* Action buttons - Only Run and Test on mobile */
  .action-buttons {
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    flex-shrink: 0;
  }

  .action-btn {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .action-btn.primary,
  .action-btn.success {
    min-width: auto;
  }

  /* Hide navigation buttons on mobile */
  .ide-navigation {
    display: none;
  }

  /* Modal - Full width on mobile */
  .modal-content {
    width: 95vw;
    max-width: none;
  }

  .modal-header h3 {
    font-size: 16px;
  }

  .modal-body p {
    font-size: 14px;
  }
}

@media (max-width: 640px) {
  /* Extra compact for small phones */
  .title-bar {
    min-height: 48px;
    padding: 6px 8px;
  }

  .title-bar-left,
  .title-bar-right {
    gap: 6px;
  }

  .home-link {
    width: 28px;
    height: 28px;
  }

  .title-text {
    font-size: 12px;
  }

  .difficulty-badge-small {
    font-size: 10px;
    padding: 2px 4px;
  }

  .breadcrumb {
    display: none;
  }

  /* Terminal - Compact height on small screens */
  .right-panel {
    min-height: 220px;
  }

  .terminal-body {
    font-size: 13px;
    line-height: 1.7;
    padding: 10px;
    border-left: none;
    border-right: none;
  }


  /* Action buttons - Smaller on small screens */
  .action-btn {
    padding: 9px 14px;
    font-size: 12px;
  }


  /* Notepad - Mobile friendly */
  .notepad-container {
    margin: 5px;
  }

  .notepad-textarea {
    font-size: 12px;
    padding: 12px 15px;
    line-height: 22px;
  }

  /* Empty state - More compact */
  .empty-state-container {
    padding: 20px;
  }

  .empty-state-title {
    font-size: 18px;
  }

  .empty-state-subtitle {
    font-size: 12px;
  }

  .empty-file-item {
    padding: 10px 15px;
    font-size: 12px;
  }
}

/* Landscape mobile - Adjust terminal height and optimize layout */
@media (max-width: 768px) and (orientation: landscape) {
  .right-panel {
    min-height: 180px;
  }

  .terminal-body {
    font-size: 13px;
    line-height: 1.7;
    border-left: none;
    border-right: none;
  }

  .ide-navigation {
    display: none;
  }

  .title-bar {
    min-height: 44px;
  }

  .action-btn {
    padding: 8px 12px;
    font-size: 11px;
  }
}

/* Notepad Styling */
.notepad-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, rgba(24, 8, 50, 0.9), rgba(6, 10, 28, 0.92));
  border-radius: 18px;
  margin: 10px;
  box-shadow: 0 24px 48px -28px rgba(196, 76, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.notepad-header {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.75), rgba(196, 76, 255, 0.85));
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.notepad-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.notepad-info {
  font-size: 12px;
  opacity: 0.8;
}

.notepad-content {
  flex: 1;
  position: relative;
  background: linear-gradient(160deg, rgba(14, 10, 32, 0.85), rgba(4, 8, 24, 0.92));
}

.notepad-textarea {
  width: 100%;
  height: 100%;
  background: rgba(10, 8, 28, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  outline: none;
  resize: none;
  padding: 18px 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 24px;
  color: var(--text-primary);
  overflow-y: auto;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.notepad-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

/* Empty State Styling */
.empty-state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 48px;
  color: var(--text-primary);
  background: radial-gradient(circle at top, rgba(255, 107, 157, 0.18), transparent 65%);
}

.unicorn-outline {
  margin-bottom: 32px;
  color: rgba(148, 163, 184, 0.55);
}

.empty-state-title {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #f8fafc;
}

.empty-state-subtitle {
  font-size: 15px;
  margin-bottom: 32px;
  opacity: 0.8;
  color: var(--text-muted);
}

.empty-state-files {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-file-item {
  padding: 14px 22px;
  background: rgba(196, 76, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: 0 18px 40px -32px rgba(196, 76, 255, 0.55);
}

.empty-file-item:hover {
  background: rgba(196, 76, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}
