* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-bg: #282a36;
  --secondary-bg: #21222c;
  --text-primary: #f8f8f2;
  --accent: #44475a;
  --button-run: #6272a4;
  --button-toggle: #44475a;
  --border-color: #44475a;
  --tab-active: #8be9fd;
  --tab-inactive: #44475a;
  --blue-accent: #8be9fd;
  --light-blue: #b3e5fc;
}

.light-theme {
  --primary-bg: #f8f8f2;
  --secondary-bg: #ffffff;
  --text-primary: #282a36;
  --accent: #e1e1e6;
  --button-run: #2196f3;
  --button-toggle: #e1e1e6;
  --border-color: #e1e1e6;
  --tab-active: #03a9f4;
  --tab-inactive: #e1e1e6;
  --blue-accent: #03a9f4;
  --light-blue: #e3f2fd;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--primary-bg);
  color: var(--text-primary);
  transition: background-color 0.3s, color 0.3s;
  overflow: hidden;
}

.navbar {
  background-color: var(--secondary-bg);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 50px;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 8px;
  border-radius: 4px;
  background: none;
  flex-shrink: 0;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 18px;
  font-weight: bold;
  color: var(--blue-accent);
}

.logo i {
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
}

.file-dropdown {
  position: relative;
  display: inline-block;
}

.file-dropdown-btn {
  background: linear-gradient(145deg, var(--secondary-bg), var(--accent));
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.file-dropdown-btn:hover {
  background: linear-gradient(145deg, var(--accent), var(--blue-accent));
  border-color: var(--blue-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.file-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  min-width: 180px;
  margin-top: 4px;
}

.file-dropdown-content.show {
  display: block;
}

.file-dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-primary);
  transition: background-color 0.2s ease;
}

.file-dropdown-item:hover {
  background-color: var(--accent);
}

.file-dropdown-item:first-child {
  border-radius: 6px 6px 0 0;
}

.file-dropdown-item:last-child {
  border-radius: 0 0 6px 6px;
}

.file-dropdown-item i {
  width: 16px;
  text-align: center;
}

#fileInput {
  display: none;
}

.language-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.current-language {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  background: linear-gradient(145deg, var(--blue-accent), var(--light-blue));
  color: #1a1a1a;
  border-radius: 16px;
  margin-right: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.language-selector {
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.2s ease;
  min-width: 200px;
}

.language-selector:hover {
  background: var(--secondary-bg);
  border-color: var(--blue-accent);
  transform: none;
  box-shadow: 0 0 0 1px var(--blue-accent);
}

.language-selector:focus {
  outline: none;
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 2px rgba(139, 233, 253, 0.2);
}

.language-selector option {
  background-color: var(--secondary-bg);
  color: var(--text-primary);
  padding: 8px 12px;
  border: none;
  font-size: 14px;
}

.language-selector option:hover,
.language-selector option:checked {
  background-color: var(--blue-accent);
  color: var(--primary-bg);
}

.light-theme .language-selector {
  background: var(--secondary-bg);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.light-theme .language-selector:hover {
  border-color: var(--blue-accent);
  box-shadow: 0 0 0 1px var(--blue-accent);
}

.light-theme .language-selector option {
  background-color: var(--secondary-bg);
  color: var(--text-primary);
}

.light-theme .language-selector option:hover,
.light-theme .language-selector option:checked {
  background-color: var(--blue-accent);
  color: white;
}

.navbar-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.run-button {
  background: linear-gradient(145deg, var(--button-run), #4a90e2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.run-button:hover {
  background: linear-gradient(145deg, #4a90e2, var(--blue-accent));
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.run-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.run-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: linear-gradient(145deg, #666, #555);
}

.theme-toggle {
  background: linear-gradient(145deg, var(--button-toggle), var(--accent));
  border: 1px solid var(--accent);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: 24px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.theme-toggle:hover {
  background: linear-gradient(145deg, var(--accent), var(--blue-accent));
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.theme-toggle:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Simplified main container layout - removed file explorer */
.main-container {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

.split-container {
  display: flex;
  width: 100%;
  height: 100%;
}

.left-pane {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  background-color: var(--primary-bg);
}

/* Added dedicated filename header above code editor */
.filename-header {
  background-color: var(--secondary-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.filename-header i {
  color: var(--blue-accent);
  font-size: 16px;
}

/* Editor now has flexible height that adjusts with resizing */
#editor {
  flex: 2;
  width: 100%;
  flex-shrink: 0;
  min-height: 150px;
}

/* Right pane simplified to only contain output */
.right-pane {
  width: 50%;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  background-color: var(--secondary-bg);
}

.resize-handle-horizontal {
  width: 4px;
  background-color: var(--accent);
  cursor: col-resize;
  transition: background-color 0.2s;
  position: relative;
}

.resize-handle-horizontal:hover {
  background-color: var(--tab-active);
}

.resize-handle-horizontal::after {
  content: "";
  position: absolute;
  top: 0;
  left: -2px;
  right: -2px;
  bottom: 0;
}

/* Added vertical resize handle styling */
.resize-handle-vertical {
  height: 4px;
  background-color: var(--accent);
  cursor: row-resize;
  transition: background-color 0.2s;
  position: relative;
  flex-shrink: 0;
  z-index: 10;
}

.resize-handle-vertical:hover {
  background-color: var(--tab-active);
}

.resize-handle-vertical::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -2px;
  bottom: -2px;
}

/* Output section now takes full height of right pane */
.output-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Input section now has flexible height with proper constraints */
.input-section {
  flex: 1;
  min-height: 120px;
  max-height: calc(100vh - 250px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid var(--accent);
  flex-shrink: 0;
}

.section-header {
  background-color: var(--secondary-bg);
  padding: 8px 16px;
  border-bottom: 1px solid var(--accent);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  min-height: 33px;
}

.section-content {
  flex: 1;
  padding: 16px;
  overflow: hidden;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.4;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Added scrollbar support specifically for output section */
.output-section .section-content {
  overflow-y: auto;
  overflow-x: hidden;
}

.input-area {
  width: 100%;
  height: 100%;
  flex: 1;
  background-color: transparent;
  border: none;
  color: var(--text-primary);
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 14px;
  resize: none;
  outline: none;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  box-sizing: border-box;
  display: block;
}

.output-area {
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text-primary);
  overflow-wrap: break-word;
  flex: 1;
  min-height: 0;
}

/* Enhanced status bar with footer text */
.status-bar {
  height: 48px;
  background: linear-gradient(145deg, var(--secondary-bg), var(--accent));
  border-top: 1px solid var(--accent);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 32px;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 -2px 4px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.status-item {
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-value {
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: linear-gradient(145deg, var(--accent), var(--secondary-bg));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Added footer text styling */
.footer-text {
  margin-left: auto;
  color: var(--text-primary);
  font-size: 12px;
  opacity: 0.8;
  font-weight: 400;
}

.loading {
  color: #ffa500;
  background: linear-gradient(145deg, rgba(255, 165, 0, 0.2), rgba(255, 165, 0, 0.1));
}
.error {
  color: #ff6b6b;
  background: linear-gradient(145deg, rgba(255, 107, 107, 0.2), rgba(255, 107, 107, 0.1));
}
.success {
  color: var(--blue-accent);
  background: linear-gradient(145deg, rgba(139, 233, 253, 0.2), rgba(139, 233, 253, 0.1));
}
