:root {
  --bg-app: #0f172a;
  --bg-panel: #020617;
  --bg-header: #020617;
  --border: #1e293b;
  --accent: #38bdf8;
  --accent-hover: #0ea5e9;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
}

/* ===== BASE ===== */
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: var(--bg-app);
  color: var(--text-primary);
}

/* ===== HEADER ===== */
header {
  background: var(--bg-header);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title {
  font-weight: 700;
  font-size: 18px;
  background: linear-gradient(135deg, #3A8DFF, #00E5FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* NAV */
nav {
  display: flex;
}

nav a {
  margin-left: 20px;
  text-decoration: none;
  color: #cbd5f5;
  transition: 0.3s;
}

nav a:hover {
  color: var(--accent);
}

/* MOBILE MENU */
.menu-toggle {
  display: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--accent);
}

/* ===== LAYOUT ===== */
.compare-container {
  padding: 30px;
}

/* ===== UPLOAD ===== */
.upload-section {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.upload-box {
  flex: 1;
  background: var(--bg-panel);
  border: 1px dashed var(--border);
  padding: 15px;
  border-radius: 10px;
}

.upload-box label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.upload-box input {
  width: 100%;
}

/* ===== EDITORS ===== */
.compare-inputs {
  display: flex;
  gap: 20px;
}

.editor-box {
  flex: 1;
  background: var(--bg-panel);
  border-radius: 10px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.editor-header {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #d4d4d4;
  padding: 15px;
  font-family: monospace;
  font-size: 13px;
  resize: none;
  min-height: 300px;
}

/* ===== BUTTON ===== */
.compare-action {
  text-align: center;
  margin: 25px 0;
}

.compare-action button {
  background: var(--accent);
  color: #020617;
  border: none;
  padding: 12px 30px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

.compare-action button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* ===== RESULTS ===== */
.compare-results {
  background: var(--bg-panel);
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 20px;
}

.results-header {
  font-size: 14px;
  margin-bottom: 15px;
  color: var(--text-secondary);
}

/* SUMMARY */
.result-summary {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
}

.result-card {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: bold;
}

.added {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
}

.removed {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.changed {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* DETAILS */
.result-details {
  background: #010409;
  padding: 15px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 13px;
  max-height: 300px;
  overflow-y: auto;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 15px;
  margin-top: 30px;
  color: #64748b;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

  .menu-toggle {
    display: block;
  }

  nav {
    display: none;
    flex-direction: column;
    width: 100%;
    background: var(--bg-header);
  }

  nav.active {
    display: flex;
  }

  nav a {
    margin: 10px;
  }

  .compare-inputs {
    flex-direction: column;
  }

  .upload-section {
    flex-direction: column;
  }

  .result-summary {
    flex-direction: column;
  }
}

/* Hide default input */
.custom-file-upload input[type="file"] {
  display: none;
}

/* Custom button */
.custom-file-upload {
  display: inline-block;
  padding: 10px 18px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  color: black;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s ease;
}

.custom-file-upload:hover {
  background: linear-gradient(135deg, #3A8DFF, #00E5FF);
}

/* File name text */
.file-name {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: #bbb;
}

/* Upload section as 2 columns */
.upload-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* 2 equal columns */
  gap: 20px;
  margin-bottom: 20px;
}

/* Each box styling */
.upload-box {
  display: flex;
  flex-direction: column;
}

/* Align button + filename */
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Responsive (mobile) */
@media (max-width: 768px) {
  .upload-section {
    grid-template-columns: 1fr;
    /* stack on small screens */
  }
}

/* Git-style diff colors */

.diff-added {
  background: rgba(0, 255, 0, 0.1);
  color: #4caf50;
  padding: 6px;
  border-left: 4px solid #4caf50;
  margin: 4px 0;
  font-family: monospace;
}

.diff-removed {
  background: rgba(255, 0, 0, 0.1);
  color: #f44336;
  padding: 6px;
  border-left: 4px solid #f44336;
  margin: 4px 0;
  font-family: monospace;
}

.diff-block {
  margin-bottom: 15px;
}