/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #0d0f12;
  --bg2: #141720;
  --bg3: #1c2030;
  --border: #2a3040;
  --text: #e8ecf2;
  --muted: #7a8499;
  --accent: #4a7ab5;
  --accent2: #7a8499;
  --green: #2ecc71;
  --red: #e74c3c;
  --radius: 8px;
  --font-head: "Barlow Condensed", sans-serif;
  --font-body: "Barlow", sans-serif;
}

/* ── Animations ─────────────────────────────────────────────────────────────── */
.carousel-fade-enter-active,
.carousel-fade-leave-active {
  transition: opacity 0.6s ease;
}
.carousel-fade-enter-from,
.carousel-fade-leave-to {
  opacity: 0;
}

@keyframes pulse-live {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent2);
}
img {
  max-width: 100%;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
.header {
  background: #0a2347;
  border-bottom: none;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 12px;
}
.logo {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.logo span {
  color: rgba(255, 255, 255, 0.7);
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nav-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.85);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-btn:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.nav-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent2);
  font-weight: 600;
}
.nav-btn.primary:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* ── Language switcher ──────────────────────────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.lang-btn {
  background: none;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.6);
  padding: 4px 7px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lang-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.lang-btn.active {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.15);
}

/* ── Search bar ─────────────────────────────────────────────────────────────── */
.search-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.search-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}
.search-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 16px 10px 44px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39, 76, 119, 0.1);
}
.search-input::placeholder {
  color: var(--muted);
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text);
  font-size: 25px;
}

.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.search-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.search-result-item:hover {
  background: var(--bg3);
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-name {
  font-weight: 500;
  font-size: 15px;
}
.search-result-horse {
  color: var(--muted);
  font-size: 13px;
}
.search-result-event {
  color: var(--accent);
  font-size: 12px;
  font-family: var(--font-head);
  letter-spacing: 0.5px;
}

.badge-ready {
  background: rgba(22, 163, 74, 0.1);
  color: var(--green);
  border: 1px solid rgba(22, 163, 74, 0.25);
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-head);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ── Page ───────────────────────────────────────────────────────────────────── */
.page {
  padding: 32px 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.page-title {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: var(--accent2);
}
.page-subtitle {
  color: var(--muted);
  margin-bottom: 28px;
}

/* ── Events grid ────────────────────────────────────────────────────────────── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.event-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.event-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(39, 76, 119, 0.12);
}
.event-card-cover {
  height: 140px;
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--border);
  position: relative;
  overflow: hidden;
}
.event-card-cover::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg2));
}
.event-card-body {
  padding: 14px 16px 18px;
}
.event-card-name {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  line-height: 1.2;
}
.event-card-meta {
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--accent);
}
.breadcrumb a:hover {
  color: var(--accent2);
}
.breadcrumb .sep {
  color: var(--border);
}
.breadcrumb .current {
  color: var(--text);
  font-weight: 500;
}

/* ── Classes list ───────────────────────────────────────────────────────────── */
.classes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.class-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.class-card:hover {
  border-color: var(--accent);
  background: var(--bg3);
}
.class-card-name {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.class-card-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.class-card-arrow {
  color: var(--muted);
  font-size: 20px;
}

/* ── Participants table ──────────────────────────────────────────────────────── */
.participants-table {
  width: 100%;
  border-collapse: collapse;
}
.participants-table th {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.participants-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.participants-table tr:hover td {
  background: var(--bg3);
}
.participants-table tr {
  cursor: pointer;
  transition: background 0.15s;
}

.start-nr {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.rider-name {
  font-weight: 500;
  font-size: 15px;
}
.horse-name {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}
.video-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-head);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.badge-r1 {
  background: rgba(39, 76, 119, 0.1);
  color: var(--accent);
  border: 1px solid rgba(39, 76, 119, 0.25);
}
.badge-r2 {
  background: rgba(27, 58, 102, 0.1);
  color: var(--accent2);
  border: 1px solid rgba(27, 58, 102, 0.25);
}
.badge-pending {
  background: rgba(90, 112, 144, 0.08);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge-published {
  background: rgba(22, 163, 74, 0.1);
  color: var(--green);
  border: 1px solid rgba(22, 163, 74, 0.25);
}
.badge-draft {
  background: rgba(90, 112, 144, 0.08);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Player ─────────────────────────────────────────────────────────────────── */
.player-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px;
}
.video-wrapper {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.video-wrapper video {
  width: 100%;
  height: 100%;
  display: block;
}
.video-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  font-family: var(--font-head);
  font-size: 18px;
  color: #fff;
  gap: 12px;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.video-info {
  margin-bottom: 20px;
}
.video-title {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--accent2);
}
.video-meta {
  color: var(--muted);
  font-size: 14px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.round-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.round-btn {
  padding: 8px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.round-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.round-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
}
.action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  padding: 9px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover {
  background: #1b3a66;
  color: #fff;
}
.btn-secondary {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg3);
}
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* ── Auth ───────────────────────────────────────────────────────────────────── */
.auth-page {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}
.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.auth-title {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--accent2);
}
.auth-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39, 76, 119, 0.1);
}
.form-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 6px;
}
.btn-full {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 15px;
}
.auth-link {
  text-align: center;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

/* ── Me page ────────────────────────────────────────────────────────────────── */
.my-videos-event {
  margin-bottom: 36px;
}
.my-videos-event-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: var(--accent2);
}
.my-videos-event-date {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}
.participation-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.participation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.participation-name {
  font-weight: 500;
}
.participation-class {
  color: var(--muted);
  font-size: 13px;
}

/* ── Empty / Loading ────────────────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}
.empty-title {
  font-family: var(--font-head);
  font-size: 22px;
  color: var(--text);
  margin-bottom: 8px;
}
.loading {
  text-align: center;
  padding: 60px;
  color: var(--muted);
}

/* ── Responsive tablette ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-inner {
    height: auto;
    padding: 10px 0;
    flex-wrap: wrap;
  }
  .header {
    padding: 0 12px;
  }
  .logo {
    font-size: 18px;
  }
  .logo img {
    height: 36px !important;
  }
  .nav {
    gap: 6px;
  }
  .nav-btn {
    padding: 5px 10px;
    font-size: 12px;
  }
  .page {
    padding: 20px 12px;
  }
  .player-page {
    padding: 16px 12px;
  }
  .events-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
  }
  .page-title {
    font-size: 26px;
  }
  .video-title {
    font-size: 20px;
  }
  .action-bar {
    flex-direction: column;
  }
  .action-bar .btn {
    justify-content: center;
  }
  div[style*="height:420px"] {
    height: 240px !important;
    border-radius: 10px !important;
  }
  div[style*="font-size:42px"] {
    font-size: 24px !important;
  }
  div[style*="bottom:40px"] {
    bottom: 16px !important;
    left: 16px !important;
  }
}

/* ── Responsive mobile ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .events-grid {
    grid-template-columns: 1fr;
  }
  .header-inner {
    height: auto;
    min-height: 56px;
    padding: 8px 0;
  }
  .logo {
    font-size: 16px;
  }
  .logo img {
    height: 30px !important;
  }
  .nav-btn {
    padding: 5px 8px;
    font-size: 12px;
  }
  .participants-table th:nth-child(3),
  .participants-table td:nth-child(3) {
    display: none;
  }
  .auth-card {
    padding: 24px 16px;
  }
  .page-title {
    font-size: 22px;
  }
  .breadcrumb {
    font-size: 12px;
  }
  div[style*="height:420px"] {
    height: 200px !important;
  }
  div[style*="font-size:42px"] {
    font-size: 20px !important;
  }
  .lang-btn {
    padding: 3px 5px;
    font-size: 11px;
  }
  .search-bar {
    padding: 8px 12px;
  }
  .search-input {
    font-size: 14px;
    padding: 8px 12px 8px 38px;
  }
}

/* ── Touch friendly ─────────────────────────────────────────────────────────── */
@media (hover: none) {
  .event-card:hover {
    transform: none;
  }
  .event-card:active {
    opacity: 0.85;
    transform: scale(0.98);
  }
  .class-card:active {
    opacity: 0.85;
  }
  .participants-table tr:active td {
    background: var(--bg3);
  }
}

/* ── CMS ─────────────────────────────────────────────────────────── */
.cms-content {
  max-width: 800px;
  line-height: 1.8;
}
.cms-content h2 {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  margin: 24px 0 12px;
  color: var(--accent2);
}
.cms-content h3 {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  margin: 20px 0 10px;
  color: var(--accent);
}
.cms-content p {
  margin-bottom: 16px;
}
.cms-content ul,
.cms-content ol {
  margin: 12px 0 16px 24px;
}
.cms-content li {
  margin-bottom: 6px;
}
.cms-content a {
  color: var(--accent);
}
.cms-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  margin: 16px 0;
  color: var(--muted);
  font-style: italic;
}
.cms-form {
  max-width: 600px;
  margin: 24px 0;
}
.cms-form-placeholder {
  margin: 24px 0;
}
