/* ============================================================
   BE_AEG — BattlEye Exception Generator — stylesheet
   dze.armatools.com/be-aeg
   ============================================================ */
:root {
  --bg:          #0d0d0d;
  --bg-panel:    #111111;
  --bg-card:     #1c1c1c;
  --bg-card2:    #222222;
  --border:      #2a2a2a;
  --border-hi:   #3e5a28;
  --accent:      #4e8a2e;
  --accent-hi:   #62ae3a;
  --accent-dim:  #2e5018;
  --text:        #d0d0d0;
  --text-muted:  #5e5e5e;
  --text-hi:     #eaeaea;
  --danger:      #c0392b;
  --danger-hi:   #e74c3c;
  --success:     #27ae60;
  --success-hi:  #2ecc71;
  --warn-bg:     #1a1400;
  --warn-bd:     #4a3800;
  --warn-txt:    #c8a832;
  --radius:      6px;
  --shadow:      0 2px 12px rgba(0,0,0,.55);
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:        'Consolas', 'Courier New', monospace;
  --max-w:       min(960px, 96vw);
}

/* ─── Light mode ─── */
[data-theme="light"] {
  --bg:          #f5f5f4;
  --bg-panel:    #ececea;
  --bg-card:     #ffffff;
  --bg-card2:    #f0f0ee;
  --border:      #cccccc;
  --border-hi:   #5a9e30;
  --accent:      #3d7020;
  --accent-hi:   #2e5818;
  --accent-dim:  #cce4b0;
  --text:        #222222;
  --text-muted:  #666666;
  --text-hi:     #111111;
  --warn-bg:     #fdf6e0;
  --warn-bd:     #d4a800;
  --warn-txt:    #7a5800;
  --shadow:      0 2px 12px rgba(0,0,0,.10);
}

[data-theme="light"] code {
  background: #eef4e8;
  border-color: #b8d898;
  color: #2e6010;
}
[data-theme="light"] .tool-header {
  background: #e8f2de;
  border-bottom-color: #b8d4a0;
}
[data-theme="light"] .privacy-card {
  background: #e8f4de;
  border-color: #a0c880;
  color: #2e6010;
}
[data-theme="light"] .privacy-card strong { color: #1a4a08; }

[data-theme="light"] .drop-zone { border-color: #aaaaaa; background: #f9f9f8; }
[data-theme="light"] .drop-zone:hover,
[data-theme="light"] .drop-zone.drag-over { border-color: var(--accent); background: #edf6e4; }
[data-theme="light"] .drop-zone.has-file { border-color: #5a9e30; background: #edf6e4; }

[data-theme="light"] .stats-bar {
  background: #e8f4de;
  border-color: #a0c880;
}
[data-theme="light"] .stat-value { color: #2a5810; }
[data-theme="light"] .stat-label { color: #4a6a38; }

[data-theme="light"] .log-box {
  background: #f0f4ec;
  border-color: #b0c890;
  color: #2a3820;
}

[data-theme="light"] .info-card {
  background: #fff8e0;
  border-color: var(--warn-bd);
}
[data-theme="light"] .info-card strong { color: var(--warn-txt); }

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── Tool Header ─── */
.tool-header {
  background: #0f1a0a;
  border-bottom: 1px solid var(--border-hi);
  padding: 1.25rem 1.25rem;
}
.tool-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.tool-header-title {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tool-header-icon { font-size: 2rem; line-height: 1; }
.tool-header-title h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-hi);
  line-height: 1.2;
}
.tool-header-sub {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: .3rem;
}
.tool-header-sub a { color: inherit; }
.tool-header-link {
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent-hi);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: .35rem .85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.tool-header-link:hover {
  background: rgba(78,138,46,.15);
  border-color: var(--accent-hi);
}

/* ─── Main ─── */
main {
  max-width: var(--max-w);
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ─── Cards ─── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

/* ─── Privacy card ─── */
.privacy-card {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  background: #0e1a09;
  border-color: var(--border-hi);
  font-size: .88rem;
  color: var(--accent-hi);
}
.privacy-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ─── Upload grid ─── */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.upload-zone { display: flex; flex-direction: column; gap: .5rem; }
.upload-label {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.upload-label span { color: var(--text-hi); }
.optional-badge {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: .05rem .35rem;
  vertical-align: middle;
  text-transform: none;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--bg-panel);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(78,138,46,.06);
}
.drop-zone.has-file {
  border-color: var(--accent-hi);
  border-style: solid;
  background: rgba(78,138,46,.08);
}
.drop-zone input[type="file"] { display: none; }

.drop-icon { font-size: 1.8rem; }
.drop-main {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-hi);
}
.drop-sub {
  font-size: .78rem;
  color: var(--text-muted);
}
.drop-filename {
  font-size: .82rem;
  color: var(--accent-hi);
  font-weight: 600;
  word-break: break-all;
}
.drop-clear {
  font-size: .75rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: .15rem .4rem;
  border-radius: 3px;
  transition: color .15s, background .15s;
}
.drop-clear:hover { color: var(--danger-hi); background: rgba(192,57,43,.12); }

/* ─── Actions ─── */
.actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .65rem 1.5rem;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hi); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

.btn-download {
  background: #1a3a0a;
  color: var(--accent-hi);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: .65rem 1.5rem;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn-download:hover:not(:disabled) {
  background: rgba(78,138,46,.2);
  border-color: var(--accent-hi);
}
.btn-download:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Stats bar ─── */
.stats-bar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: #0e1a09;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: .85rem 1.25rem;
}
.stat { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-hi);
  line-height: 1;
}
.stat-label {
  font-size: .72rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: .2rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ─── Info/warning card ─── */
.info-card {
  display: flex;
  gap: .85rem;
  background: var(--warn-bg);
  border: 1px solid var(--warn-bd);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: .88rem;
  color: var(--warn-txt);
}
.info-card-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: .1rem; }
.info-card strong { color: var(--warn-txt); font-weight: 700; }
.info-card a { color: inherit; text-decoration: underline; }
.info-card ul { margin: .4rem 0 0 1.2rem; }
.info-card li { margin-bottom: .2rem; }

code {
  font-family: var(--mono);
  font-size: .85em;
  background: #1a1a0a;
  border: 1px solid #2a2a10;
  border-radius: 3px;
  padding: .05em .35em;
  color: #c8b040;
}

/* ─── Log box (merge mode) ─── */
.log-wrap { display: none; }
.log-wrap.visible { display: block; }
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .6rem;
}
.log-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.copy-btn {
  font-size: .75rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 3px;
  padding: .2rem .55rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.copy-btn:hover { color: var(--text-hi); border-color: var(--accent); }

.log-box {
  font-family: var(--mono);
  font-size: .78rem;
  background: #0f140c;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre;
  color: var(--accent-hi);
  line-height: 1.5;
}

/* ─── Restriction table (log-only mode) ─── */
.restriction-table {
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0f140c;
}

.restriction-row {
  display: grid;
  grid-template-columns: 5rem 1fr auto;
  align-items: stretch;
  border-bottom: 1px solid rgba(78,138,46,.18);
}
.restriction-row:last-child { border-bottom: none; }

.r-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .65rem .4rem;
  border-right: 1px solid rgba(78,138,46,.18);
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.2;
  gap: .15rem;
}
.r-line-num {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-hi);
  line-height: 1;
}

.r-exceptions {
  padding: .6rem .85rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--accent-hi);
  line-height: 1.65;
  word-break: break-all;
  align-self: center;
}

.r-copy-btn {
  align-self: center;
  margin: .4rem .6rem;
  font-size: .72rem;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 3px;
  padding: .25rem .55rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
  font-family: inherit;
}
.r-copy-btn:hover { color: var(--text-hi); border-color: var(--accent); background: rgba(78,138,46,.08); }
.r-copy-btn.copied { color: var(--success-hi); border-color: var(--success); }

[data-theme="light"] .restriction-table { background: #f0f4ec; }
[data-theme="light"] .restriction-row { border-bottom-color: #cde0b8; }
[data-theme="light"] .r-line { border-right-color: #cde0b8; color: #5a7a4a; }
[data-theme="light"] .r-line-num { color: #2a5810; }
[data-theme="light"] .r-exceptions { color: #2a5810; }
[data-theme="light"] .r-copy-btn { border-color: #aaaaaa; color: #666; }
[data-theme="light"] .r-copy-btn:hover { color: #2a5810; border-color: #5a9e30; background: rgba(78,138,46,.08); }
[data-theme="light"] .r-copy-btn.copied { color: #2e8050; border-color: #2e8050; }

/* ─── Hidden ─── */
.hidden { display: none !important; }

/* ─── Responsive ─── */
@media (max-width: 600px) {
  .upload-grid { grid-template-columns: 1fr; }
  .stats-bar { gap: 1rem; justify-content: center; }
  .tool-header-title h1 { font-size: 1.2rem; }
  .actions { flex-direction: column; align-items: stretch; }
  .btn-primary, .btn-download { text-align: center; justify-content: center; }
}
