/* =========================================================
   Backend Assessment Platform - Design System & Modern UI
   ========================================================= */

:root {
  --bg-main: #0b0f19;
  --bg-card: #111827;
  --bg-card-hover: #1f2937;
  --bg-input: #0f172a;
  --border-color: #1e293b;
  --border-focus: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --accent-blue: #38bdf8;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --code-bg: #090d16;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Header & Navigation */
header.app-header {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.brand-icon {
  font-size: 1.5rem;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  display: inline-flex;
}
.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.timer-badge {
  background: #1e293b;
  border: 1px solid #334155;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #fbbf24;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-web { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-erp { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-crm { background: rgba(168, 85, 247, 0.15); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-py { background: rgba(234, 179, 8, 0.15); color: #facc15; border: 1px solid rgba(234, 179, 8, 0.3); }
.badge-ai { background: rgba(236, 72, 153, 0.15); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.3); }
.badge-hard { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid #d97706; }
.badge-expert { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid #e11d48; box-shadow: 0 0 10px rgba(244, 63, 94, 0.3); }
.badge-pass { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #059669; }
.badge-fail { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid #e11d48; }
.badge-pending { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid #d97706; }
.badge-draft { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

.timer-badge.urgent {
  color: #f43f5e;
  border-color: #e11d48;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(244, 63, 94, 0); }
  100% { transform: scale(1.05); box-shadow: 0 0 12px rgba(244, 63, 94, 0.6); }
}

.sq-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.sq-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}
.btn-secondary {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}
.btn-secondary:hover {
  background: #334155;
}
.btn-success {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
}
.btn-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #ffffff;
}

/* Main Container */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  flex: 1;
}

/* Category Tabs */
.bug-nav-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}
.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}
.nav-tab-btn:hover {
  color: var(--text-main);
  background: rgba(30, 41, 59, 0.5);
}
.nav-tab-btn.active {
  color: #ffffff;
  background: #1e293b;
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}
.nav-tab-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}
.nav-tab-status.completed {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Split Pane Workspace */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  min-height: calc(100vh - 220px);
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-header {
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.panel-body {
  padding: 1.25rem;
  flex: 1;
  overflow-y: auto;
}

/* Code & Terminal Display */
pre.code-block, pre.terminal-block {
  background: var(--code-bg);
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  color: #cbd5e1;
  overflow-x: auto;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}
pre.terminal-block {
  color: #f87171;
  background: #090a0f;
  border-left: 3px solid #ef4444;
}

/* Tabs inside right panel */
.sub-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding: 0.5rem 1rem 0;
  background: rgba(15, 23, 42, 0.4);
}
.sub-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.sub-tab-btn:hover {
  color: var(--text-main);
}
.sub-tab-btn.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}
label.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
input.form-control, textarea.form-control, select.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid #334155;
  color: var(--text-main);
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: border-color 0.15s;
}
textarea.form-control {
  font-family: var(--font-mono);
  resize: vertical;
}
input.form-control:focus, textarea.form-control:focus, select.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Diff View */
.diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.diff-col {
  background: #090d16;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-x: auto;
  max-height: 500px;
}
.diff-header {
  font-weight: bold;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  overflow-y: auto;
  padding: 1.5rem;
}
.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  max-width: 620px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.6rem 2rem;
  box-shadow: 0 25px 35px -5px rgba(0, 0, 0, 0.7);
  margin: auto;
}
.modal-content.large {
  max-width: 1100px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.btn-start-test {
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: 1px solid #3b82f6;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease-in-out;
}
.btn-start-test:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.65);
  transform: translateY(-1px);
}
.modal-body {
  overflow-y: auto;
  margin: 1rem 0;
}

/* Test Runner Simulator Box */
.sim-box {
  background: #060910;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
}
.sim-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #1e293b;
  font-size: 0.85rem;
}
.sim-item:last-child {
  border-bottom: none;
}
.sim-status {
  font-weight: bold;
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.sim-pass {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}
.sim-fail {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
}

/* Admin Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.data-table th, .data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}
.data-table th {
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}
.data-table tr:hover {
  background: rgba(30, 41, 59, 0.4);
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: 10px;
}
.kpi-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}
.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  margin-top: 0.25rem;
}

/* Footer */
footer.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 1rem 2rem;
  color: var(--text-subtle);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 1024px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

/* Language Selection Pills */
.lang-pills {
  display: inline-flex;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.2rem;
  border-radius: 8px;
  border: 1px solid #1e293b;
}
.lang-pill {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.lang-pill:hover {
  background: #1e293b;
  color: #f1f5f9;
}
.lang-pill.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.45);
}

