/* ── Upload bar ─────────────────────────────────────────────────────────────── */
.upload-bar {
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #1e2130;
}

#drop-zone {
  border: 2px dashed #3b4262;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #64748b;
  font-size: 0.875rem;
  user-select: none;
}

#drop-zone.drag-over {
  border-color: #a78bfa;
  background: rgba(167,139,250,0.07);
  color: #a78bfa;
}

#drop-zone input[type="file"] { display: none; }

#upload-status {
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  display: none;
}

#upload-status.ok  { background: rgba(52,211,153,0.15); color: #34d399; display: block; }
#upload-status.err { background: rgba(248,113,113,0.15); color: #f87171; display: block; }

/* ── Top area: selector + analysis side by side ─────────────────────────────── */
.top-area {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  border-bottom: 1px solid #1e2130;
}

.selector {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.25rem 2rem;
  flex: 0 0 auto;
  border-right: 1px solid #1e2130;
}

@media (max-width: 860px) {
  .selector {
    flex: 1 1 100%;
    border-right: none;
    border-bottom: 1px solid #1e2130;
  }
}

/* ── Analysis panel ──────────────────────────────────────────────────────────── */
.analysis-panel {
  flex: 1 1 320px;
  min-width: 0;
  padding: 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.analysis-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.analysis-panel h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
}

.analysis-panel .model-badge {
  font-size: 0.7rem;
  color: #475569;
  background: #1e2130;
  border: 1px solid #2d3148;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
}

#analysis-body {
  flex: 1;
  font-size: 0.875rem;
  line-height: 1.65;
  color: #cbd5e1;
  overflow-y: auto;
}

#analysis-body.placeholder {
  color: #334155;
  font-style: italic;
  display: flex;
  align-items: center;
}

#analysis-body.loading {
  color: #475569;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#analysis-body.loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #3b4262;
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Markdown output styles within analysis body */
#analysis-body h2, #analysis-body h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: #a78bfa;
  margin: 0.8rem 0 0.3rem;
}

#analysis-body p { margin-bottom: 0.5rem; }
#analysis-body ul, #analysis-body ol { padding-left: 1.2rem; margin-bottom: 0.5rem; }
#analysis-body li { margin-bottom: 0.2rem; }
#analysis-body strong { color: #e2e8f0; }
#analysis-body hr { border: none; border-top: 1px solid #2d3148; margin: 0.75rem 0; }

/* ── Calendar ───────────────────────────────────────────────────────────────── */
.calendar-card {
  background: #1a1d2e;
  border: 1px solid #2d3148;
  border-radius: 10px;
  padding: 1rem 1.1rem 1.1rem;
  flex-shrink: 0;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.cal-nav button {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.cal-nav button:hover { color: #e2e8f0; background: #2d3148; }

.cal-nav span {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e2e8f0;
  min-width: 130px;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 34px);
  gap: 2px;
}

.cal-dow {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
}

.cal-cell {
  height: 34px;
  width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.85rem;
  position: relative;
}

.cal-cell.empty { pointer-events: none; }

.cal-cell.no-battles {
  color: #334155;
  cursor: default;
}

.cal-cell.has-battles {
  color: #cbd5e1;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.cal-cell.has-battles:hover {
  background: #2d3148;
  color: #e2e8f0;
}

/* dot indicator for battles */
.cal-cell.has-battles::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #a78bfa;
}

.cal-cell.today { box-shadow: inset 0 0 0 1px #3b4262; }

.cal-cell.selected {
  background: #a78bfa !important;
  color: #0f1117 !important;
  font-weight: 700;
}

.cal-cell.selected::after { background: #0f1117; }

/* ── Battle selector (right of calendar) ────────────────────────────────────── */
.battle-selector {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.battle-selector label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #475569;
}

select {
  background: #1e2130;
  color: #e2e8f0;
  border: 1px solid #3b4262;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  min-width: 260px;
}

select:focus { outline: 2px solid #a78bfa; outline-offset: 2px; }

#no-battles-hint {
  font-size: 0.85rem;
  color: #475569;
  font-style: italic;
}

/* ── Content area ───────────────────────────────────────────────────────────── */
#content { padding: 0 2rem 3rem; }

/* Scoped: überschreibt nicht das allgemeine .section-title aus styles.css */
#content .section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin: 2rem 0 1rem;
}

/* Scoped: Chart-Karten brauchen border-radius statt clip-path */
#content .card {
  background: #1a1d2e;
  border: 1px solid #2d3148;
  border-radius: 10px;
  padding: 1.5rem;
  clip-path: none;
}

#content .card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 1.25rem;
}

#pie-wrapper {
  max-width: 520px;
  margin: 0 auto;
}

.ship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 1.25rem;
}

.chart-container {
  position: relative;
  height: 260px;
}

#placeholder {
  color: #475569;
  padding: 4rem 2rem;
  text-align: center;
  font-size: 0.95rem;
}
