/* ittypingtest.com - Developer & Programming Code Typing Arena (VS Code Dark Theme) */
:root {
  --bg-editor: #1e1e1e;
  --bg-sidebar: #252526;
  --bg-card: #2d2d2d;
  --border: #3e3e42;
  --text-main: #d4d4d4;
  --text-muted: #858585;
  --code-blue: #569cd6;
  --code-yellow: #dcdcaa;
  --code-green: #4ec9b0;
  --code-string: #ce9178;
  --code-comment: #6a9955;
  --accent-red: #f43f5e;
  --active-highlight: #264f78;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #181818;
  color: var(--text-main);
  line-height: 1.6;
  padding-bottom: 60px;
}

/* Header */
.ide-header {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ide-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
  color: var(--code-blue);
  font-family: "Courier New", Courier, monospace;
}

.ide-logo span.code-tag {
  color: var(--code-yellow);
}

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

.ide-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}

.ide-nav a:hover, .ide-nav a.active {
  color: var(--code-blue);
}

/* Main Container */
.ide-container {
  max-width: 1040px;
  margin: 28px auto;
  padding: 0 16px;
}

/* Hero Section */
.ide-hero {
  text-align: center;
  margin-bottom: 24px;
}

.ide-hero h1 {
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.ide-hero p {
  color: var(--text-muted);
  font-size: 15px;
}

/* Language Filter Pills */
.ide-lang-pills {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.ide-pill {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: "Courier New", Courier, monospace;
}

.ide-pill:hover {
  border-color: var(--code-blue);
  color: var(--code-blue);
}

.ide-pill.active {
  background: var(--code-blue);
  color: #ffffff;
  border-color: var(--code-blue);
}

/* Editor Window Mockup */
.ide-editor-window {
  background: var(--bg-editor);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  margin-bottom: 30px;
}

.ide-window-bar {
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ide-window-dots {
  display: flex;
  gap: 6px;
}

.ide-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.ide-dot.red { background: #ff5f56; }
.ide-dot.yellow { background: #ffbd2e; }
.ide-dot.green { background: #27c93f; }

.ide-window-title {
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  color: var(--text-muted);
}

/* HUD Panel */
.ide-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
  background: #1a1a1a;
  border-bottom: 1px solid var(--border);
}

.ide-hud-box {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}

.ide-hud-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.ide-hud-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--code-green);
  font-family: "Courier New", Courier, monospace;
}

.ide-hud-val.accent {
  color: var(--code-yellow);
}

/* Code Typing Arena */
.ide-code-stage {
  padding: 24px;
  font-family: "Consolas", "Courier New", Courier, monospace;
  font-size: 18px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: none;
  min-height: 160px;
}

.ide-char {
  color: #64748b;
}

.ide-char.active {
  background: var(--active-highlight);
  color: #ffffff;
  border-radius: 2px;
}

.ide-char.correct {
  color: #4ade80;
}

.ide-char.incorrect {
  background: rgba(244, 63, 94, 0.3);
  color: var(--accent-red);
  border-radius: 2px;
}

/* Input Row */
.ide-input-bar {
  padding: 16px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
}

.ide-input {
  flex: 1;
  background: var(--bg-editor);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  color: #ffffff;
  font-size: 16px;
  font-family: "Consolas", "Courier New", monospace;
  outline: none;
}

.ide-input:focus {
  border-color: var(--code-blue);
  box-shadow: 0 0 0 2px rgba(86, 156, 214, 0.2);
}

.ide-btn-reset {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.ide-btn-reset:hover {
  background: var(--code-blue);
  color: #ffffff;
}

/* Article / Educational */
.ide-article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 30px;
}

.ide-article h2 {
  font-size: 22px;
  color: #ffffff;
  margin-bottom: 12px;
}

.ide-article p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 15px;
}

.ide-article code {
  background: #1e1e1e;
  color: var(--code-yellow);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", Courier, monospace;
}

.ide-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.ide-article th, .ide-article td {
  border: 1px solid var(--border);
  padding: 12px;
  text-align: left;
  font-size: 14px;
}

.ide-article th {
  background: #252526;
  color: #ffffff;
}

/* Footer */
.ide-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.ide-footer a {
  color: var(--code-blue);
  text-decoration: none;
  margin: 0 8px;
}

.ide-footer a:hover {
  text-decoration: underline;
}



/* ========================================================
   IDE GUTTER, MULTI-LINE CODE STAGE & SCORECARD MODAL
   ======================================================== */
.ide-code-stage {
  display: flex;
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 15px;
  line-height: 1.6;
  max-height: 280px;
  overflow-y: auto;
  background: #1e1e1e;
  border-bottom: 1px solid var(--border);
}

.ide-gutter {
  padding: 14px 10px;
  background: #252526;
  color: #6e7681;
  text-align: right;
  user-select: none;
  border-right: 1px solid #333;
}

.ide-line-num {
  font-size: 13px;
}

.ide-code-lines {
  padding: 14px 16px;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-all;
}

.ide-newline {
  color: #555;
  font-size: 11px;
  margin-left: 4px;
}

/* Modal Overlay */
.ide-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.ide-modal-card {
  background: #1e1e1e;
  color: #d4d4d4;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  max-width: 580px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  overflow: hidden;
  animation: popIn 0.25s ease-out;
}

.ide-modal-header {
  background: #252526;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #3c3c3c;
}

.ide-modal-header h3 {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

.ide-modal-close {
  background: none;
  border: none;
  color: #a6a6a6;
  font-size: 22px;
  cursor: pointer;
}

.ide-modal-body {
  padding: 20px;
}

.ide-score-hero {
  text-align: center;
  background: #252526;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 20px;
}

.ide-score-val {
  font-size: 40px;
  font-weight: 900;
  color: #38bdf8;
  font-family: monospace;
}

.ide-score-sub {
  font-size: 13px;
  font-weight: 700;
  color: #4ade80;
  margin-top: 6px;
  text-transform: uppercase;
}

.ide-modal-table {
  width: 100%;
  border-collapse: collapse;
}

.ide-modal-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #333333;
  font-size: 14px;
}

.ide-modal-table td strong {
  color: #ffffff;
}

.ide-modal-footer {
  padding: 14px 20px;
  background: #252526;
  border-top: 1px solid #3c3c3c;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ide-btn-primary {
  background: #0e639c;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.ide-btn-secondary {
  background: #333333;
  color: #ffffff;
  border: 1px solid #444444;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}
