/* =========================================
   Brabantsedag Jury – Global Dark Theme
   ========================================= */

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  color: #ffffff;
  font-weight: 600;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
  color: #CC2229;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- Container --- */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* --- Navigation --- */
nav {
  background: #0f3460;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  border-bottom: 1px solid #2a2a4a;
}

nav .nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-right: auto;
}

nav a {
  color: #b0b0cc;
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
}

nav a.active {
  background: rgba(204, 34, 41, 0.25);
  color: #CC2229;
  font-weight: 600;
}

/* --- Cards & Panels --- */
.card {
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  padding: 32px;
}

.card-sm {
  padding: 24px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
  line-height: 1.4;
}

.btn-lg {
  padding: 14px 36px;
  font-size: 1.125rem;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: #CC2229;
  color: #ffffff;
}

.btn-primary:hover {
  background: #a81b21;
  box-shadow: 0 2px 8px rgba(204, 34, 41, 0.3);
}

.btn-secondary {
  background: #2a2a4a;
  color: #e0e0e0;
}

.btn-secondary:hover {
  background: #3a3a5a;
}

.btn-danger {
  background: #8b1a1a;
  color: #ffffff;
}

.btn-danger:hover {
  background: #6b1414;
}

.btn-ghost {
  background: transparent;
  color: #b0b0cc;
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.875rem;
}

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

/* --- Form Elements --- */
input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  background: #0f3460;
  color: #e0e0e0;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 10px 14px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #CC2229;
  box-shadow: 0 0 0 3px rgba(204, 34, 41, 0.2);
}

input::placeholder, textarea::placeholder {
  color: #6a6a8a;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23b0b0cc' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

select option {
  background: #0f3460;
  color: #e0e0e0;
}

select option:disabled {
  color: #4a4a6a;
}

label {
  display: block;
  font-size: 0.9rem;
  color: #b0b0cc;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
}

.form-row .form-group {
  flex: 1;
}

/* Checkbox styling */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-wrap input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: #CC2229;
}

/* File input */
input[type="file"] {
  padding: 8px;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  background: #2a2a4a;
  color: #e0e0e0;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  margin-right: 12px;
  cursor: pointer;
  font-size: 0.875rem;
}

input[type="file"]::file-selector-button:hover {
  background: #3a3a5a;
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.125rem;
}

thead {
  border-bottom: 2px solid #2a2a4a;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: #b0b0cc;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid #2a2a4a;
  vertical-align: middle;
}

tbody tr {
  transition: background 0.15s;
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* --- Divider --- */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: #6a6a8a;
  font-size: 0.9rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #2a2a4a;
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  border-bottom: 2px solid #2a2a4a;
  padding-bottom: 0;
}

.tab-btn {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  background: transparent;
  color: #6a6a8a;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
}

.tab-btn:hover {
  color: #b0b0cc;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #CC2229;
  border-bottom-color: #CC2229;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* --- Thumbnail / Avatar --- */
.thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #2a2a4a;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #ffffff;
  flex-shrink: 0;
}

/* --- Alerts / Messages --- */
.alert {
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.alert-error {
  background: rgba(204, 34, 41, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(204, 34, 41, 0.3);
}

.alert-success {
  background: rgba(46, 204, 113, 0.15);
  color: #6bff8e;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

/* --- Inline Form (for admin table editing) --- */
.inline-form {
  background: #16213e;
  border: 1px solid #CC2229;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.inline-form h3 {
  margin-bottom: 16px;
}

.inline-form .btn-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* --- Collapsible Section --- */
.collapsible-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #b0b0cc;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 8px 0;
  transition: color 0.2s;
}

.collapsible-toggle:hover {
  color: #ffffff;
}

.collapsible-toggle .arrow {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 0.75rem;
}

.collapsible-toggle.open .arrow {
  transform: rotate(90deg);
}

.collapsible-body {
  display: none;
  padding-top: 16px;
}

.collapsible-body.open {
  display: block;
}

/* --- Login Specific --- */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-card h1 {
  text-align: center;
  margin-bottom: 8px;
}

.login-card .subtitle {
  text-align: center;
  color: #6a6a8a;
  margin-bottom: 32px;
  font-size: 1rem;
}

/* --- Header bar --- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Utility --- */
.text-muted { color: #6a6a8a; }
.text-sm { font-size: 0.875rem; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* --- Chairman badge --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-chairman {
  background: rgba(204, 34, 41, 0.2);
  color: #CC2229;
}

/* =========================================
   Scoring Page
   ========================================= */

/* Container override for scoring — wider */
.scoring-container {
  max-width: 1600px;
}

/* --- Source Row --- */
.source-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px;
  background: #16213e;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #2a2a4a;
  min-height: 92px;
  align-items: flex-start;
}

.source-card {
  width: 70px;
  text-align: center;
  cursor: grab;
  flex-shrink: 0;
  padding: 4px;
  border-radius: 8px;
  transition: opacity 0.2s, transform 0.15s;
  user-select: none;
}

.source-card:hover {
  transform: translateY(-2px);
}

.source-card:active {
  cursor: grabbing;
}

.source-card-done {
  opacity: 0.35;
}

.source-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

.source-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: #ffffff;
}

.source-label {
  font-size: 0.75rem;
  color: #b0b0cc;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

/* --- Scoring Layout --- */
.scoring-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* --- Scoring Matrix --- */
.scoring-matrix-wrap {
  flex: 1;
  min-width: 0;
}

.scoring-matrix-scroll {
  overflow-x: auto;
}

.scoring-matrix {
  border-collapse: collapse;
  width: 100%;
}

.scoring-matrix tbody tr:nth-child(even) {
  background: transparent;
}

.scoring-matrix tbody tr:hover {
  background: transparent;
}

.scoring-matrix thead {
  border-bottom: 2px solid #2a2a4a;
}

.matrix-pos-header {
  width: 50px;
  text-align: center;
  padding: 10px 8px;
  font-size: 0.85rem;
  color: #b0b0cc;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.matrix-jury-header {
  width: 90px;
  min-width: 80px;
  text-align: center;
  padding: 10px 4px;
  font-size: 0.8rem;
  color: #b0b0cc;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matrix-pos-cell {
  width: 50px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  padding: 6px 8px;
  border-bottom: 1px solid #2a2a4a;
  vertical-align: middle;
}

.matrix-drop-cell {
  width: 90px;
  min-width: 80px;
  height: 64px;
  border: 1px dashed #2a2a4a;
  text-align: center;
  vertical-align: middle;
  padding: 4px;
  transition: background 0.15s, border-color 0.15s;
}

.matrix-drop-cell:hover {
  border-color: #4a4a6a;
  background: rgba(255, 255, 255, 0.02);
}

.matrix-cell-filled {
  border-style: solid;
  border-color: #3a3a5a;
  background: rgba(204, 34, 41, 0.06);
}

/* --- Matrix Card (inside cells) --- */
.matrix-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: grab;
  padding: 2px;
  border-radius: 6px;
  user-select: none;
}

.matrix-card:active {
  cursor: grabbing;
}

.matrix-card-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}

.matrix-card-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
}

.matrix-card-name {
  font-size: 0.65rem;
  color: #b0b0cc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
  font-weight: 600;
}

/* SortableJS ghost/chosen styling */
.sortable-ghost {
  opacity: 0.4;
}

.sortable-chosen {
  opacity: 0.8;
}

.sortable-drag {
  opacity: 0.9;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* --- Ranking Panel --- */
.ranking-panel {
  min-width: 300px;
  max-width: 380px;
  flex-shrink: 0;
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  padding: 16px;
}

.ranking-title-header {
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #2a2a4a;
}

.ranking-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px dotted #2a2a4a;
}

.ranking-row:last-child {
  border-bottom: none;
}

.ranking-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.ranking-badge-active {
  background: #CC2229;
  color: #ffffff;
}

.ranking-badge-empty {
  background: #2a2a4a;
  color: #6a6a8a;
}

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

.ranking-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-subtitle {
  font-size: 0.8rem;
  color: #6a6a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-points {
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  white-space: nowrap;
  flex-shrink: 0;
}

/* =========================================
   Pearls & Mentions Page
   ========================================= */

.pearls-section,
.mentions-section {
  margin-bottom: 32px;
}

.section-subtitle {
  color: #6a6a8a;
  font-size: 1rem;
  margin-top: 4px;
  margin-bottom: 20px;
}

/* --- Pearl Category Cards --- */
.pearl-categories {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pearl-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #16213e;
  border: 1px solid #2a2a4a;
  border-radius: 12px;
  padding: 20px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pearl-card:hover {
  border-color: #3a3a5a;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.pearl-indicator {
  width: 6px;
  height: 48px;
  border-radius: 3px;
  flex-shrink: 0;
}

.pearl-indicator-overdracht {
  background: #d4a017;
}

.pearl-indicator-theatraal {
  background: #CC2229;
}

.pearl-indicator-vormgeving {
  background: #1abc9c;
}

.pearl-content {
  flex: 1;
  min-width: 0;
}

.pearl-label {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 10px;
}

.pearl-select {
  width: 100%;
  font-size: 1rem;
}

/* Category-specific card accents */
.pearl-card-overdracht {
  border-left: 3px solid #d4a017;
}

.pearl-card-theatraal {
  border-left: 3px solid #CC2229;
}

.pearl-card-vormgeving {
  border-left: 3px solid #1abc9c;
}

/* --- Mention Rows --- */
.mention-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mention-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mention-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: #b0b0cc;
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}

.mention-input {
  flex: 1;
  font-size: 1rem;
}

/* --- Pearls Actions Bar --- */
.pearls-actions {
  margin-top: 32px;
  display: flex;
  justify-content: flex-end;
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
  }

  .container {
    padding: 16px;
  }

  nav {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 4px;
  }

  nav .nav-brand {
    width: 100%;
    margin-bottom: 4px;
  }

  th, td {
    padding: 8px 10px;
  }

  /* Scoring page: stack layout vertically on mobile */
  .scoring-layout {
    flex-direction: column;
  }

  .ranking-panel {
    min-width: unset;
    max-width: unset;
    width: 100%;
  }

  /* Pearls page responsive */
  .pearl-card {
    padding: 16px;
  }

  .pearls-actions {
    justify-content: stretch;
  }

  .pearls-actions .btn {
    width: 100%;
  }
}
