/* ============================================
   MDI Generator — App Page Styles
   Used only by app.html
   ============================================ */

/* ─── Midnight Overrides (App-specific) ───── */

/* Void ambient glow behind hero */
[data-theme="midnight"] .hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(124,58,237,.12) 0%, rgba(247,185,10,.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="midnight"] .hero {
  position: relative;
}

[data-theme="midnight"] .hero > .container {
  position: relative;
  z-index: 1;
}

/* Gold accent for headings in midnight */
[data-theme="midnight"] .section-title {
  background: linear-gradient(135deg, #f7b90a, #fcd34d 40%, #f7b90a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="midnight"] .footer-col h4 {
  color: var(--gold);
}

[data-theme="midnight"] .footer-col a:hover {
  color: var(--gold-light);
}

/* Feature card gold border on hover */
[data-theme="midnight"] .feature-card:hover {
  border-color: rgba(247,185,10,.4);
  box-shadow: 0 4px 20px rgba(124,58,237,.12), 0 0 40px rgba(247,185,10,.06);
}

/* Void glow on wizard content */
[data-theme="midnight"] .wizard-content {
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 80px rgba(124,58,237,.06);
}

/* FAQ hover gold */
[data-theme="midnight"] .faq-item summary:hover {
  color: var(--gold);
}

/* Gold step numbers */
[data-theme="midnight"] .step-item-number {
  background: linear-gradient(135deg, #7c3aed, #f7b90a);
  box-shadow: 0 4px 16px rgba(124,58,237,.3);
}

/* CTA section midnight */
[data-theme="midnight"] .cta-section {
  background: linear-gradient(135deg, rgba(124,58,237,.08), rgba(247,185,10,.05), rgba(124,58,237,.08));
}

/* Alt-bg midnight */
[data-theme="midnight"] .landing-section.alt-bg {
  background: rgba(26,18,40,.4);
}

/* Hero stats gold glow */
[data-theme="midnight"] .hero-stat-number {
  background: linear-gradient(135deg, #f7b90a, #fcd34d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Stat boxes in app */
[data-theme="midnight"] .stat-value {
  background: linear-gradient(135deg, #a78bfa, #f7b90a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Wizard header gradient */
[data-theme="midnight"] .wizard-header h1 {
  background: linear-gradient(135deg, #a78bfa, #f7b90a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Team header gold */
[data-theme="midnight"] .team-header {
  background: linear-gradient(135deg, #a78bfa, #f7b90a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Modal midnight */
[data-theme="midnight"] .modal-box {
  background: #1a1228;
  border-color: #2d2244;
}

[data-theme="midnight"] .modal-box h2 {
  background: linear-gradient(135deg, #a78bfa, #f7b90a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="midnight"] .modal-box h3 {
  color: var(--gold);
}

/* Ban count gold in midnight */
[data-theme="midnight"] .ban-count {
  color: var(--gold);
  background: rgba(247,185,10,.1);
}

/* Player name highlight purple */
[data-theme="midnight"] .player-name-highlight {
  color: #a78bfa;
}

/* Class header midnight accent */
[data-theme="midnight"] .class-header {
  background: rgba(124,58,237,.08);
}

[data-theme="midnight"] .tank { background: #2563eb; }
[data-theme="midnight"] .healer { background: #16a34a; }
[data-theme="midnight"] .dps { background: #b91c1c; }

[data-theme="midnight"] .role-badge.Tank { background: rgba(59,130,246,.2); color: #60a5fa; }
[data-theme="midnight"] .role-badge.Healer { background: rgba(22,163,74,.2); color: #4ade80; }
[data-theme="midnight"] .role-badge.DPS { background: rgba(185,28,28,.2); color: #f87171; }

[data-theme="midnight"] .team-card:hover {
  border-color: #7c3aed;
  box-shadow: 0 8px 24px rgba(124, 58, 237, .15);
}

[data-theme="midnight"] .wizard-step.active {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, .1);
}

[data-theme="midnight"] .wizard-step.active .ws-number {
  background: #7c3aed;
}

[data-theme="midnight"] .dungeon-badge {
  background: linear-gradient(135deg, rgba(247,185,10,.12), rgba(124,58,237,.08));
  border-color: rgba(247,185,10,.3);
  color: #fcd34d;
}

[data-theme="midnight"] .toast {
  border-color: #f7b90a;
}

[data-theme="midnight"] .cta-section {
  background: linear-gradient(135deg, rgba(124,58,237,.1), rgba(247,185,10,.08));
}

[data-theme="midnight"] .wizard-step.completed {
  border-color: #f7b90a;
  background: rgba(247,185,10,.05);
}

[data-theme="midnight"] .footer-bar {
  background: rgba(26,18,40,.96);
}

[data-theme="midnight"] input[type=checkbox] {
  accent-color: #7c3aed;
}

/* ─── Wizard Layout ───────────────────────── */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 120px;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}

.wizard-header {
  text-align: center;
  margin-bottom: 24px;
}

.wizard-header h1 {
  font-size: 26px;
  margin: 0 0 6px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.wizard-header-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.wizard-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  transition: all .3s;
}

.wizard-step.active { border-color: var(--accent); background: var(--accent-soft); }
.wizard-step.completed { border-color: var(--success); background: rgba(16,185,129,.05); }

.ws-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.wizard-step.active .ws-number { background: var(--accent); color: #fff; }
.wizard-step.completed .ws-number { background: var(--success); color: #fff; }
.ws-label { font-weight: 600; font-size: 13px; }

.wizard-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.step-content { display: none; flex-direction: column; flex: 1; }
.step-content.active { display: flex; }
.step-content h2 { font-size: 20px; margin: 0 0 6px; font-weight: 600; }
.subtitle { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

/* ─── Forms ───────────────────────────────── */
textarea, input, select {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  transition: all .2s;
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  width: 100%;
  min-height: 160px;
  padding: 12px;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 12px;
}

input[type=number] { padding: 10px; width: 100%; max-width: 160px; font-size: 15px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent); }

.prepopulate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.prepopulate-row select {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

/* ─── Player Chips ────────────────────────── */
.player-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.player-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  transition: all .2s;
}
.player-chip:hover { border-color: var(--accent); }

/* ─── Blacklist ───────────────────────────── */
.blacklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.player-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: 500px;
  transition: all .2s;
}

.player-card:hover { border-color: var(--accent); }

.player-card-header {
  font-size: 15px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-name-highlight {
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}

.ban-count {
  font-size: 11px;
  color: var(--warning);
  background: rgba(245,158,11,.1);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.player-card-body {
  flex: 1;
  overflow-y: auto;
  margin-top: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.player-card-body::-webkit-scrollbar { width: 4px; }
.player-card-body::-webkit-scrollbar-track { background: transparent; }
.player-card-body::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 8px; }

.class-group { margin: 6px 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.class-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: var(--accent-soft);
  cursor: pointer;
  user-select: none;
}
.class-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.class-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.08);
  object-fit: cover;
  flex-shrink: 0;
}

.class-title { font-weight: 700; font-size: 13px; }
.class-toggle { font-size: 11px; color: var(--muted); }

.spec-list { padding: 5px 8px; display: flex; flex-direction: column; gap: 3px; }
.spec-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px;
  cursor: pointer;
  border-radius: 6px;
  transition: all .15s;
}
.spec-checkbox:hover { background: var(--accent-soft); }
.spec-checkbox input { cursor: pointer; accent-color: var(--accent); width: 14px; height: 14px; flex-shrink: 0; }

.spec-icon-sm {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.08);
  object-fit: cover;
  flex-shrink: 0;
}

.spec-checkbox label { cursor: pointer; font-size: 12px; margin: 0; flex: 1; }

.role-badge {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.role-badge.Tank { background: rgba(59,130,246,.25); color: #60a5fa; }
.role-badge.Healer { background: rgba(22,163,74,.25); color: #4ade80; }
.role-badge.DPS { background: rgba(185,28,28,.25); color: #f87171; }

.quick-actions { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }

/* ─── Preview / Settings ──────────────────── */
.preview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-box {
  background: var(--bg);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2px;
}

.stat-label { color: var(--muted); font-size: 11px; font-weight: 500; }

.settings-grid { display: grid; gap: 14px; margin-bottom: 18px; }
.setting-item {
  background: var(--bg);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.setting-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin: 0;
}

/* ─── Teams ───────────────────────────────── */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.team-card {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all .3s;
}

.team-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--card-hover-glow);
}

.team-header {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.team-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(20,27,38,.5);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all .2s;
}

.team-member:hover { background: var(--panel); }

.member-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.member-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.member-name { font-weight: 600; font-size: 13px; white-space: nowrap; }
.member-spec-name { font-size: 12px; color: var(--muted); white-space: nowrap; }

.spec-icon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,.1);
  object-fit: cover;
  flex-shrink: 0;
}

.badge {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.tank { background: #2563eb; color: #fff; }
.healer { background: #16a34a; color: #fff; }
.dps { background: #b91c1c; color: #fff; }

.bench-section {
  margin-top: 16px;
  padding: 14px;
  background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--radius-md);
}
.bench-section strong { color: var(--warning); }

/* ─── Dungeon Badge ───────────────────────── */
.dungeon-badge {
  background: linear-gradient(135deg, rgba(139,92,246,.15), rgba(124,58,237,.1));
  border: 1px solid rgba(139,92,246,.3);
  color: #c4b5fd;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
}

/* ─── Sticky Footer Bar ───────────────────── */
.footer-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: rgba(20,27,38,.96);
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  box-shadow: 0 -8px 30px rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-bar .btn { white-space: nowrap; }

/* ─── App Footer ──────────────────────────── */
.site-footer {
  padding: 48px 0 24px;
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 { font-size: 14px; margin-bottom: 12px; color: var(--accent); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--muted); text-decoration: none; font-size: 13px; transition: color 0.2s; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* ─── Modal ───────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .2s;
  line-height: 1;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,.05); }

.modal-box h2 {
  font-size: 20px;
  margin: 0 0 16px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.modal-box h3 { font-size: 15px; margin: 16px 0 6px; color: var(--accent); }
.modal-box p { color: var(--muted); font-size: 13px; margin: 0 0 8px; line-height: 1.7; }

/* ─── Shared CTA ──────────────────────────── */
.shared-cta {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ─── Toast ───────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel);
  border: 1px solid var(--success);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  z-index: 99999;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Animations ──────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.step-content.active { animation: fadeIn .3s ease; }

/* ─── Responsive (App) ────────────────────── */
@media (max-width: 768px) {
  .section-title { font-size: 28px; }
  .wizard-steps { flex-direction: column; align-items: stretch; }
  .blacklist-grid { grid-template-columns: 1fr; }
  .teams-grid { grid-template-columns: 1fr; }
  .wizard-header h1 { font-size: 20px; }
}
