/* portal.css – Design-System Sprecherportal
   Dunkles Glassmorphism, Plus Jakarta Sans, Amber-Akzent */

/* ─── Google Font ──────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ─── CSS Custom Properties ────────────────────────────────────────── */

:root {
  /* Hintergründe */
  --bg-body: #1a1a2e;
  --bg-card: #16213e;
  --bg-card-hover: #1a2847;
  --bg-card-glass: rgba(22, 33, 62, 0.7);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-input-focus: rgba(255, 255, 255, 0.1);

  /* Akzent */
  --accent: #e8862a;
  --accent-hover: #d07825;
  --accent-soft: rgba(232, 134, 42, 0.15);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b80;

  /* Borders */
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-input: rgba(255, 255, 255, 0.12);
  --border-input-focus: rgba(232, 134, 42, 0.5);

  /* Radius */
  --radius-card: 12px;
  --radius-input: 8px;
  --radius-btn: 8px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-btn: 0 2px 8px rgba(232, 134, 42, 0.3);

  /* Transitions */
  --transition: 0.2s ease;
}

/* ─── Reset & Base ─────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

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

img {
  max-width: 100%;
  height: auto;
}

/* ─── Layout ───────────────────────────────────────────────────────── */

.portal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 3rem;
  position: relative;
}

.portal-header {
  width: 100%;
  max-width: 800px;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2rem;
}

.portal-content {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ─── Logo ─────────────────────────────────────────────────────────── */

.portal-logo {
  width: 180px;
  margin-bottom: 2rem;
  opacity: 0.95;
}

/* ─── Headings ─────────────────────────────────────────────────────── */

.portal-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  text-align: center;
}

.portal-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

/* ─── Cards ────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-card);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  width: 100%;
  margin-bottom: 2rem;
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* ─── Buttons ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-btn);
  width: 100%;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232, 134, 42, 0.4);
  color: #fff;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Form Inputs ──────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  background: var(--bg-input-focus);
  border-color: var(--border-input-focus);
  box-shadow: 0 0 0 3px rgba(232, 134, 42, 0.1);
}

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

/* ─── Error / Success Messages ─────────────────────────────────────── */

.form-error {
  color: #e05555;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  text-align: center;
}

.form-success {
  color: #5ba88c;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  text-align: center;
}

/* ─── Language Toggle ──────────────────────────────────────────────── */

.lang-toggle {
  display: flex;
  gap: 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 3px;
  border: 1px solid var(--border-glass);
}

.lang-btn {
  padding: 0.3rem 0.8rem;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

.lang-btn.active {
  background: var(--accent);
  color: #fff;
}

.lang-btn:not(.active):hover {
  color: var(--text-primary);
}

/* ─── Footer Link ──────────────────────────────────────────────────── */

.portal-footer-link {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.portal-footer-link a {
  font-weight: 500;
}

/* ─── Auth Pages (Login, Register) ─────────────────────────────────── */

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
}

.auth-card .portal-title {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.auth-card .portal-subtitle {
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
}

.auth-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 1.5rem 0;
}

/* ─── Status Badges ────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-pending {
  background: rgba(212, 160, 23, 0.15);
  color: #d4a017;
}

.badge-active {
  background: rgba(91, 168, 140, 0.15);
  color: #5ba88c;
}

.badge-inactive {
  background: rgba(160, 160, 176, 0.15);
  color: #a0a0b0;
}

/* ─── Dashboard Layout ─────────────────────────────────────────────── */

.dash-page {
  align-items: stretch;
  padding-top: 0;
}

.dash-page .portal-content {
  max-width: 900px;
  align-items: stretch;
}

/* Topbar */
.dash-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
}

.dash-topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-topbar-logo {
  height: 32px;
  opacity: 0.9;
}

.dash-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* User Info */
.dash-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.dash-user-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dash-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.dash-actions .btn {
  width: auto;
}

/* Section Headers */
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.dash-section-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.dash-section-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ─── Profilfoto-Upload ────────────────────────────────────────────── */

.profile-foto-area {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  margin-bottom: 1.5rem;
}

.profile-foto-preview {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 2px solid var(--border-input);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-foto-placeholder {
  font-size: 2rem;
  opacity: 0.4;
  line-height: 1;
}

.profile-foto-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.profile-foto-btn {
  cursor: pointer;
  display: inline-block;
}

/* ─── Upload Zone ──────────────────────────────────────────────────── */

.upload-zone {
  border: 2px dashed var(--border-input);
  border-radius: var(--radius-card);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1.5rem;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.upload-zone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
  opacity: 0.7;
}

.upload-zone-label {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.upload-zone-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.upload-zone input[type="file"] {
  display: none;
}

/* ─── Proben-Liste ─────────────────────────────────────────────────── */

.proben-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.proben-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-input);
  transition: background var(--transition);
}

.proben-item:hover {
  background: var(--bg-card-hover);
}

.proben-item.dragging {
  opacity: 0.5;
}

.proben-play {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
  transition: background var(--transition);
}

.proben-play:hover {
  background: var(--accent-hover);
}

.proben-info {
  flex: 1;
  min-width: 0;
}

.proben-title {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proben-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Audio Progress */
.proben-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin-top: 0.35rem;
  cursor: pointer;
  overflow: hidden;
  display: none;
}

.proben-progress.active {
  display: block;
}

.proben-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.proben-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 4px;
  font-size: 1.1rem;
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.proben-delete:hover {
  color: #e05555;
  background: rgba(224, 85, 85, 0.1);
}

.proben-drag {
  color: var(--text-muted);
  cursor: grab;
  padding: 0.25rem;
  font-size: 1rem;
  flex-shrink: 0;
  user-select: none;
}

.proben-drag:active {
  cursor: grabbing;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Profile Form ─────────────────────────────────────────────────── */

.profile-page .portal-content {
  max-width: 700px;
  align-items: stretch;
}

.profile-section {
  margin-bottom: 2rem;
}

.profile-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-required::after {
  content: ' *';
  color: var(--accent);
}

/* Chip-Selector (Multi-Select als Chips) */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.chip {
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.chip:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.chip.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
}

.toggle-row + .toggle-row {
  border-top: 1px solid var(--border-glass);
}

.toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Radio Group */
.radio-group {
  display: flex;
  gap: 1rem;
  margin-top: 0.4rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.radio-option input[type="radio"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-input);
  border-radius: 50%;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.radio-option input[type="radio"]:checked {
  border-color: var(--accent);
}

.radio-option input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  top: 2px;
  left: 2px;
}

/* Conditional sections */
.conditional-section {
  display: none;
  margin-top: 1.25rem;
}

.conditional-section.visible {
  display: block;
}

/* ─── Agentur-Tabelle ─────────────────────────────────────────────── */

.agentur-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.agentur-table th,
.agentur-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
}

.agentur-table th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.agentur-table td {
  font-size: 0.9rem;
}

.agentur-table tbody tr {
  transition: background var(--transition);
}

.agentur-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.agentur-table .td-actions {
  display: flex;
  gap: 0.5rem;
}

/* Agentur Add-Sprecher Form */
.agentur-add-form {
  margin-bottom: 1.5rem;
}

.agentur-add-form:hover {
  transform: none;
}

.agentur-add-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.agentur-add-actions .btn {
  width: auto;
}

/* ─── Btn size variants ────────────────────────────────────────────── */

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
}

/* ─── Loading Spinner ──────────────────────────────────────────────── */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ─── Responsive ───────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .portal-page {
    padding: 1.5rem 1rem 2rem;
  }

  .portal-logo {
    width: 140px;
  }

  .portal-title {
    font-size: 1.6rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 1.5rem;
  }

  .auth-card {
    padding: 1.75rem;
  }

  .dash-topbar {
    padding: 0.75rem 1rem;
  }

  .dash-user-name {
    font-size: 1.25rem;
  }

  .dash-actions {
    flex-direction: column;
  }

  .upload-zone {
    padding: 2rem 1rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
