/* ============================================================
   mode-switcher.css — Studio Mode-Switcher (national/regional/transition)
   ------------------------------------------------------------
   Additiv. Reuses .card, .btn, .btn-primary, .btn-secondary aus
   style.css. Definiert nur mode-switcher-spezifische Styles.
   ============================================================ */

/* ---- Container ------------------------------------------------------ */
.mode-switcher {
  margin-bottom: 16px;
}

.mode-switcher h3 {
  margin: 0 0 4px 0;
}

.mode-switcher-subtitle {
  color: var(--text-secondary, #666);
  margin: 0 0 16px 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

/* ---- Mode-Badge (color-coded) -------------------------------------- */
.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid transparent;
  background: var(--color-surface, #f4f4f4);
}

.mode-badge strong {
  font-weight: 700;
}

/* National = teal/blue (Energy primary) */
.mode-badge-national {
  background: color-mix(in srgb, #00c8ff 12%, transparent);
  border-color: color-mix(in srgb, #00c8ff 35%, transparent);
  color: #006a85;
}

/* Regional = blue (multi-region) */
.mode-badge-regional {
  background: color-mix(in srgb, #1e88e5 12%, transparent);
  border-color: color-mix(in srgb, #1e88e5 35%, transparent);
  color: #0d47a1;
}

/* Transition = yellow/amber (caution) */
.mode-badge-transition {
  background: color-mix(in srgb, #fbc02d 18%, transparent);
  border-color: color-mix(in srgb, #fbc02d 45%, transparent);
  color: #7c5e00;
}

/* Dark-mode variants — keep readable contrast. */
body.dark-mode .mode-badge-national {
  color: #5fd6ff;
}
body.dark-mode .mode-badge-regional {
  color: #82b1ff;
}
body.dark-mode .mode-badge-transition {
  color: #ffe082;
}

/* ---- Health-Check --------------------------------------------------- */
.mode-health {
  margin-bottom: 16px;
}

.health-result {
  margin-top: 10px;
}

.health-ok {
  padding: 10px 14px;
  background: color-mix(in srgb, #2e7d32 10%, transparent);
  border: 1px solid color-mix(in srgb, #2e7d32 35%, transparent);
  border-radius: 8px;
  color: #1b5e20;
}

.health-fail {
  padding: 10px 14px;
  background: color-mix(in srgb, #c62828 10%, transparent);
  border: 1px solid color-mix(in srgb, #c62828 35%, transparent);
  border-radius: 8px;
  color: #b71c1c;
}

.health-fail ul {
  margin: 6px 0 6px 20px;
  padding: 0;
}

.health-fail small {
  display: block;
  margin-top: 4px;
  opacity: 0.85;
}

body.dark-mode .health-ok {
  color: #a5d6a7;
}
body.dark-mode .health-fail {
  color: #ef9a9a;
}

/* ---- Mode-Action-Buttons ------------------------------------------- */
.mode-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-mode-target {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 500;
  cursor: pointer;
  background: var(--color-surface, #fff);
  transition:
    filter 0.15s ease,
    transform 0.1s ease;
}

.btn-mode-target:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-mode-national {
  background: color-mix(in srgb, #00c8ff 14%, var(--color-surface, #fff));
  border-color: color-mix(in srgb, #00c8ff 45%, transparent);
  color: #006a85;
}

.btn-mode-regional {
  background: color-mix(in srgb, #1e88e5 14%, var(--color-surface, #fff));
  border-color: color-mix(in srgb, #1e88e5 45%, transparent);
  color: #0d47a1;
}

.btn-mode-transition {
  background: color-mix(in srgb, #fbc02d 18%, var(--color-surface, #fff));
  border-color: color-mix(in srgb, #fbc02d 50%, transparent);
  color: #7c5e00;
}

/* ---- Modal --------------------------------------------------------- */
.cutover-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.cutover-modal-content {
  background: var(--color-surface, #fff);
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  width: calc(100% - 32px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.cutover-modal-content h4 {
  margin: 0 0 12px 0;
  font-size: 1.15rem;
}

.cutover-modal-content p {
  margin: 0 0 12px 0;
}

.cm-field {
  display: block;
  margin: 12px 0;
}

.cm-field > span {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
}

.cm-field input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border, #ccc);
  border-radius: 6px;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.cm-force-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: color-mix(in srgb, #c62828 8%, transparent);
  border: 1px solid color-mix(in srgb, #c62828 30%, transparent);
}

.cm-force-label input[type="checkbox"] {
  margin-top: 3px;
}

.cutover-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ---- Audit-Log Table ----------------------------------------------- */
.mode-audit {
  margin-top: 20px;
}

.mode-audit h4 {
  margin: 0 0 10px 0;
}

.mode-audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.mode-audit-table th,
.mode-audit-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border, #e5e5e5);
  text-align: left;
  vertical-align: top;
}

.mode-audit-table th {
  background: var(--color-surface-alt, #f7f7f7);
  font-weight: 600;
}

.mode-audit-empty td {
  text-align: center;
  color: var(--text-secondary, #888);
  font-style: italic;
}

body.dark-mode .mode-audit-table th {
  background: #2a2a2a;
}

body.dark-mode .mode-audit-table th,
body.dark-mode .mode-audit-table td {
  border-bottom-color: #333;
}

/* ---- Optional: page-banner if rendered (for base.html, Wave 6) ----- */
.mode-page-banner {
  display: block;
  padding: 8px 14px;
  font-size: 0.9rem;
  border-bottom: 1px solid color-mix(in srgb, #fbc02d 35%, transparent);
  background: color-mix(in srgb, #fbc02d 14%, transparent);
  color: #7c5e00;
}

.mode-page-banner a {
  color: inherit;
  text-decoration: underline;
}
