/* =========================================================
   Intervexa AI - coding.css (LeetCode Style IDE)
   ========================================================= */

:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --bg-dark: #1E1E1E;
  --bg-darker: #181818;
  --bg-editor: #1F2430;
  --border-dark: #2D3748;
  --text-dark: #F1F5F9;
  --text-muted: #94A3B8;
  --pane-bg: #FFFFFF;
  --pane-border: #E2E8F0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.coding-body {
  font-family: 'Sora', sans-serif;
  background: #F1F5F9;
  color: #1E293B;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ================= TOP NAVBAR ================= */
.code-navbar {
  height: 56px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--pane-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
  flex-shrink: 0;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.problem-navigator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F8FAFC;
  padding: 3px 6px;
  border-radius: 8px;
  border: 1px solid #E2E8F0;
}

.nav-icon-btn {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.nav-icon-btn:hover {
  background: #E2E8F0;
  color: #0F172A;
}

.problem-select {
  background: transparent;
  border: none;
  font-family: 'Sora', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1E293B;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
  max-width: 240px;
}

.nav-center {
  display: flex;
  align-items: center;
}

.session-timer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #F1F5F9;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.session-timer i {
  color: #64748B;
}

.timer-btn {
  background: transparent;
  border: none;
  color: #64748B;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 2px;
}

.timer-btn:hover {
  color: var(--primary);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quick-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  list-style: none;
}

.quick-nav a {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748B;
  padding: 6px 10px;
  border-radius: 6px;
  transition: all 0.2s;
}

.quick-nav a:hover {
  color: var(--primary);
  background: #EFF6FF;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 7px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  background: #F1F5F9;
  color: #1E293B;
  border: 1px solid #CBD5E1;
}

.btn-secondary:hover {
  background: #E2E8F0;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.8rem;
}

/* ================= WORKSPACE SPLIT LAYOUT ================= */
.workspace-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  height: calc(100vh - 56px);
  padding: 8px;
  gap: 6px;
  background: #0F172A;
}

.pane {
  background: #FFFFFF;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.left-pane {
  flex: 0 0 calc(45% - 4px);
  min-width: 320px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
}

.gutter-resizer {
  width: 6px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.2s;
  border-radius: 3px;
}

.gutter-resizer:hover, .gutter-resizer.resizing {
  background: var(--primary);
}

.right-pane {
  flex: 1;
  min-width: 400px;
  background: #181E29;
  border: 1px solid #283347;
  color: #F8FAFC;
}

/* ================= LEFT PANE: DESCRIPTION ================= */
.pane-tabs {
  display: flex;
  align-items: center;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
  padding: 0 12px;
  height: 42px;
  flex-shrink: 0;
  gap: 8px;
}

.pane-tab {
  background: transparent;
  border: none;
  font-family: 'Sora', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748B;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.pane-tab:hover {
  color: #1E293B;
}

.pane-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.tab-content.active {
  display: block;
}

.problem-meta {
  margin-bottom: 20px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.problem-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #0F172A;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-easy {
  background: #DCFCE7;
  color: #15803D;
}

.badge-medium {
  background: #FEF3C7;
  color: #B45309;
}

.badge-hard {
  background: #FEE2E2;
  color: #B91C1C;
}

.meta-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: #64748B;
}

.topic-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.topic-tag {
  background: #F1F5F9;
  color: #475569;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.problem-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #334155;
  margin-bottom: 24px;
}

.problem-body p {
  margin-bottom: 12px;
}

.problem-body code {
  background: #F1F5F9;
  color: #0F172A;
  font-family: 'Fira Code', monospace;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88rem;
}

.examples-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.example-card {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  padding: 14px 16px;
}

.example-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 8px;
}

.example-io {
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #1E293B;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  padding: 10px 12px;
  border-radius: 6px;
}

.example-explanation {
  margin-top: 8px;
  font-size: 0.85rem;
  color: #475569;
}

.constraints-card {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.constraints-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #92400E;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.constraints-card ul {
  list-style: disc;
  padding-left: 20px;
  color: #78350F;
  font-size: 0.85rem;
  font-family: 'Fira Code', monospace;
  line-height: 1.6;
}

/* Hints tab accordion */
.hint-item {
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.hint-header {
  background: #F8FAFC;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: #1E293B;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hint-content {
  padding: 14px 16px;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.6;
  background: #FFFFFF;
  display: none;
}

.hint-item.open .hint-content {
  display: block;
}

/* Submissions list */
.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #E2E8F0;
  font-size: 0.85rem;
}

.sub-status {
  font-weight: 700;
}

.sub-status.accepted { color: var(--success); }
.sub-status.wrong { color: var(--danger); }

/* ================= RIGHT PANE: CODE EDITOR ================= */
.editor-header {
  height: 42px;
  background: #141A24;
  border-bottom: 1px solid #283347;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}

.lang-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94A3B8;
  font-size: 0.85rem;
}

.lang-select {
  background: #1E2636;
  border: 1px solid #334155;
  color: #F8FAFC;
  font-family: 'Sora', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
}

.editor-tools-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 0.8rem;
  font-family: 'Sora', sans-serif;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.tool-btn:hover {
  background: #20293A;
  color: #FFFFFF;
}

/* Code Editor Wrapper */
.code-editor-wrapper {
  flex: 1;
  display: flex;
  position: relative;
  background: #181E29;
  overflow: hidden;
}

.line-numbers {
  width: 44px;
  padding: 12px 8px 12px 0;
  text-align: right;
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  line-height: 22px;
  color: #475569;
  background: #141A24;
  user-select: none;
  overflow: hidden;
  border-right: 1px solid #283347;
}

.code-textarea {
  flex: 1;
  height: 100%;
  padding: 12px;
  font-family: 'Fira Code', monospace;
  font-size: 13.5px;
  line-height: 22px;
  background: #181E29;
  color: #F8FAFC;
  border: none;
  outline: none;
  resize: none;
  white-space: pre;
  tab-size: 2;
  overflow-y: auto;
  overflow-x: auto;
}

/* ================= BOTTOM CONSOLE DRAWER ================= */
.console-drawer {
  background: #141A24;
  border-top: 1px solid #283347;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 240px;
  transition: height 0.25s ease;
}

.console-drawer.collapsed {
  height: 40px;
}

.drawer-header {
  height: 38px;
  background: #0F141E;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #242E40;
  flex-shrink: 0;
}

.drawer-tabs {
  display: flex;
  gap: 8px;
}

.drawer-tab {
  background: transparent;
  border: none;
  font-family: 'Sora', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94A3B8;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-tab:hover {
  color: #FFFFFF;
}

.drawer-tab.active {
  background: #20293A;
  color: #FFFFFF;
}

.drawer-icon-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px;
}

.drawer-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  font-family: 'Sora', sans-serif;
}

.dtab-content {
  display: none;
  height: 100%;
}

.dtab-content.active {
  display: block;
}

.testcase-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.tc-pill {
  background: #1E2636;
  border: 1px solid #334155;
  color: #94A3B8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.tc-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.testcase-textarea {
  width: 100%;
  background: #181E29;
  border: 1px solid #334155;
  color: #F8FAFC;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  padding: 8px 10px;
  border-radius: 6px;
  outline: none;
  resize: none;
}

.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #64748B;
  gap: 8px;
  font-size: 0.85rem;
}

.result-placeholder i {
  font-size: 1.8rem;
}

.status-headline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.status-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.status-title.accepted { color: var(--success); }
.status-title.wrong { color: var(--danger); }
.status-title.error { color: #F97316; }

.stat-pill {
  background: #1E2636;
  border: 1px solid #334155;
  color: #94A3B8;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 6px;
}

.test-results-cases {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-result-item {
  background: #181E29;
  border: 1px solid #283347;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
}

.case-result-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.console-output {
  font-family: 'Fira Code', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #94A3B8;
  white-space: pre-wrap;
}

.editor-bottom-bar {
  height: 38px;
  background: #0F141E;
  border-top: 1px solid #242E40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  flex-shrink: 0;
}

.shortcut-tip {
  font-size: 0.75rem;
  color: #64748B;
  display: flex;
  gap: 12px;
}

.shortcut-tip kbd {
  background: #1E2636;
  border: 1px solid #334155;
  padding: 1px 4px;
  border-radius: 3px;
  color: #94A3B8;
}

.bottom-actions {
  display: flex;
  gap: 8px;
}

