/* ============================================================
   TurnierStream Design System
   Based on Ciblu Brand Identity (Pantone 7629 / Pantone 200)
   ============================================================ */

/* --- Brand Tokens --- */
:root {
    --ciblu-primary: #5F0912;
    --ciblu-primary-700: #4A070E;
    --ciblu-primary-800: #3A050B;
    --ciblu-secondary: #BA0C2F;
    --ciblu-primary-rgb: 95, 9, 18;
    --ciblu-secondary-rgb: 186, 12, 47;
}

/* --- Semantic Color Tokens (Light) --- */
:root {
    --color-primary: var(--ciblu-primary);
    --color-primary-hover: var(--ciblu-primary-700);
    --color-primary-active: var(--ciblu-primary-800);
    --color-accent: var(--ciblu-secondary);

    --background: #F6F7F9;
    --surface: #FFFFFF;
    --surface-alt: #F0F2F5;
    --text-primary: #0B0D12;
    --text-secondary: #5C6472;
    --text-muted: #8B92A0;
    --border-color: #E2E6ED;
    --border-subtle: #EEF0F4;

    --danger: #B00020;
    --danger-bg: #FFF0F0;
    --success: #2E7D32;
    --success-bg: #F0FFF0;
    --warning: #E65100;
    --warning-bg: #FFF8E1;
    --info: #0277BD;
    --info-bg: #E8F4FD;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    --overlay: rgba(0, 0, 0, 0.5);

    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

/* --- Bootstrap Overrides --- */
:root,
[data-bs-theme="ciblu"] {
    --bs-primary: var(--ciblu-primary);
    --bs-primary-rgb: var(--ciblu-primary-rgb);
    --bs-link-color: var(--color-accent);
    --bs-link-color-rgb: var(--ciblu-secondary-rgb);
    --bs-link-hover-color: var(--color-primary);
    --bs-danger: var(--danger);
    --bs-danger-rgb: 176, 0, 32;
    --bs-body-color: var(--text-primary);
    --bs-body-bg: var(--background);
    --bs-tertiary-bg: var(--surface-alt);
    --bs-border-color: var(--border-color);
    --bs-focus-ring-color: rgba(var(--ciblu-secondary-rgb), 0.35);
    --bs-primary-bg-subtle: #F6E6EA;
    --bs-primary-border-subtle: #EBC2CD;
}

/* ============================================================
   BASE ELEMENTS
   ============================================================ */

html {
    overflow-x: clip;
}

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-accent);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary);
}

/* ============================================================
   LAYOUT
   ============================================================ */

.main-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
    padding: 2rem 0;
}

.content-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1.5rem;
}

/* ============================================================
   HEADER / NAVIGATION
   ============================================================ */

.site-header {
    background: linear-gradient(135deg, var(--ciblu-primary), var(--ciblu-primary-800));
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
    text-decoration: none;
}

.header-brand:hover {
    color: #fff;
    text-decoration: none;
}

.header-brand-logo {
    height: 44px;
    width: auto;
    filter: brightness(0) invert(1);
}

.header-brand-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.3);
}

.header-brand-product {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.header-nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
}

.header-nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.header-nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Mobile hamburger */
.header-mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.header-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.header-mobile-toggle svg {
    width: 24px;
    height: 24px;
}

.header-nav-mobile {
    display: none;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.footer-container a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-container a:hover {
    color: var(--color-primary);
}

.footer-separator {
    color: var(--text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
}

[data-bs-theme="ciblu"] .btn-primary {
    --bs-btn-bg: var(--ciblu-primary);
    --bs-btn-border-color: var(--ciblu-primary);
    --bs-btn-hover-bg: var(--ciblu-primary-700);
    --bs-btn-hover-border-color: var(--ciblu-primary-700);
    --bs-btn-active-bg: var(--ciblu-primary-800);
    --bs-btn-active-border-color: var(--ciblu-primary-800);
    --bs-btn-focus-shadow-rgb: var(--ciblu-secondary-rgb);
}

[data-bs-theme="ciblu"] .btn-outline-primary {
    --bs-btn-color: var(--ciblu-primary);
    --bs-btn-border-color: var(--ciblu-primary);
    --bs-btn-hover-bg: var(--ciblu-primary);
    --bs-btn-hover-border-color: var(--ciblu-primary);
    --bs-btn-active-bg: var(--ciblu-primary);
    --bs-btn-active-border-color: var(--ciblu-primary);
    --bs-btn-focus-shadow-rgb: var(--ciblu-secondary-rgb);
}

.btn-secondary {
    background: var(--surface-alt);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    color: var(--color-primary);
    background: rgba(var(--ciblu-primary-rgb), 0.06);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background: #8B001A;
    border-color: #8B001A;
}

.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--ciblu-secondary-rgb), 0.25);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-header p {
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================================
   FORMS
   ============================================================ */

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-accent);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
}

/* ============================================================
   LIST GROUPS (e.g., Arena/Live Selection)
   ============================================================ */

.list-group-item.active,
.list-group-item.active:focus,
.list-group-item.active:hover {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    color: #fff !important;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background-color: rgba(var(--ciblu-primary-rgb), 0.06);
}

/* ============================================================
   SPINNER / LOADING
   ============================================================ */

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

/* ============================================================
   LIVE INDICATOR
   ============================================================ */

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    color: var(--danger);
    font-size: 0.875rem;
}

.live-indicator::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse-live 1.5s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.live-card-body {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.live-card-info {
    flex: 1 1 auto;
    min-width: 0;
}

.live-card {
    border-left: 4px solid var(--color-accent);
}

.live-card .live-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.live-card .live-card-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- Upcoming List --- */

.upcoming-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    white-space: nowrap;
    overflow: hidden;
}

.upcoming-row .upcoming-title {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}

.upcoming-row .upcoming-meta {
    color: var(--text-secondary);
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* --- Header Live Dot (smaller variant for nav) --- */
.header-live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse-live 1.5s ease-in-out infinite;
    flex-shrink: 0;
    margin-left: 0.125rem;
}

/* ============================================================
   VIDEO CLIP CARDS
   ============================================================ */

.clip-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.clip-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.clip-card-thumb {
    aspect-ratio: 16/9;
    background: var(--surface-alt);
    overflow: hidden;
}

.clip-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clip-card-body {
    padding: 1rem;
}

.clip-card-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.clip-card-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* ============================================================
   VIDEO PLAYER
   ============================================================ */

.ciblu-video-player {
    background: #111;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ciblu-video-player video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.ciblu-video-player-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
}

.ciblu-video-player-toolbar .btn-sm {
    padding: 0.2rem 0.75rem;
    font-size: 0.8125rem;
}

/* ============================================================
   MODAL / OVERLAY
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content-custom {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--surface-alt);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width var(--transition-normal);
}

.progress-bar-fill.success {
    background: var(--success);
}

.progress-bar-fill.danger {
    background: var(--danger);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 420px;
    animation: slide-in-right 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}

.toast.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.toast.toast-fade-out {
    animation: fade-out-right 0.3s ease forwards;
}

@keyframes slide-in-right {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fade-out-right {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* --- Modal Buttons --- */

.modal-content-custom .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-content-custom h3 {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.modal-content-custom p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.modal-content-custom .modal-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--warning);
    font-size: 0.9rem;
    margin: 1rem 0;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-nav {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 999;
    background: var(--surface);
    color: var(--color-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    font-weight: 600;
    transition: top 0.2s ease;
}

.skip-nav:focus {
    top: 1rem;
}

/* ============================================================
   ADMIN NAVIGATION
   ============================================================ */

.admin-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.admin-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.admin-nav-link:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.admin-nav-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* --- Admin Dashboard Cards --- */

.admin-dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.admin-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.admin-card-count {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.admin-card-icon {
    font-size: 2rem;
    line-height: 1;
}

.admin-card-label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.admin-card-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .admin-nav-container {
        padding: 0 1rem;
    }

    .admin-nav-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }

    .admin-dashboard-cards {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   DISCIPLINE TABLE (Drag & Drop)
   ============================================================ */

.discipline-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    font-size: 1.125rem;
    user-select: none;
    line-height: 1;
}

.discipline-drag-handle:active {
    cursor: grabbing;
}

.discipline-row-dragging {
    opacity: 0.5;
    background: var(--surface-alt);
}

.discipline-row-dragover {
    border-top: 2px solid var(--color-accent);
}

/* ============================================================
   SPONSOR TABLE (Drag & Drop)
   ============================================================ */

.sponsor-drag-handle {
    cursor: grab;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    font-size: 1.125rem;
    user-select: none;
    line-height: 1;
}

.sponsor-drag-handle:active {
    cursor: grabbing;
}

.sponsor-row-dragging {
    opacity: 0.5;
    background: var(--surface-alt);
}

.sponsor-row-dragover {
    border-top: 2px solid var(--color-accent);
}

/* ============================================================
   BLAZOR ERROR UI
   ============================================================ */

#blazor-error-ui {
    background: var(--danger);
    color: #fff;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 0.75rem;
    text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 992px) {
    .site-content { padding: 1.5rem 0; }
    .content-container { padding: 0 1.25rem; }
    .card { padding: 1.25rem; }
}

@media (max-width: 768px) {
    .header-container {
        height: 60px;
    }

    .header-brand-logo {
        height: 36px;
    }

    .header-brand-divider,
    .header-brand-product {
        display: none;
    }

    .header-nav {
        display: none;
    }

    .header-mobile-toggle {
        display: flex;
    }

    .header-nav-mobile.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--ciblu-primary);
        box-shadow: var(--shadow-lg);
        padding: 0.5rem;
        z-index: 99;
    }

    .header-nav-mobile .header-nav-link {
        padding: 0.75rem 1rem;
        border-radius: 8px;
        width: 100%;
    }

    .site-content {
        padding: 1rem 0;
    }

    .content-container {
        padding: 0 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-container {
        flex-direction: column;
        gap: 0.25rem;
    }

    /* Home: Live card mobile */
    .live-card-body { padding: 1rem; }
    .live-card .live-card-title { font-size: 1.1rem; }
    .live-card .live-card-info { flex: 1 1 100%; }
    .live-card .btn { width: 100%; }

    /* Touch-targets */
    .btn { min-height: 44px; }
    .form-select, .form-control { min-height: 44px; }
    .list-group-item-action { min-height: 44px; display: flex; align-items: center; }
    .ciblu-btn-download { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 576px) {
    body { font-size: 1rem; }
    .site-content { padding: 0.75rem 0; }
    .content-container { padding: 0 0.75rem; }
    .card { padding: 1rem; }
    .clip-card-body { padding: 0.75rem; }
    .upcoming-row { flex-wrap: wrap; white-space: normal; }
    .upcoming-row .upcoming-meta { flex-basis: 100%; font-size: 0.8125rem; }
    .footer-separator { display: none; }
    .ciblu-badge, .ciblu-badge-soft { font-size: 0.75rem; padding: 0.2rem 0.625rem; }
    .page-header h1 { font-size: 1.25rem; }
}

/* ============================================================
   MINIMAL LAYOUT (Clip View)
   ============================================================ */

.minimal-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Clip View Page --- */

.clip-view-content {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.clip-view-player {
    margin-bottom: 1.5rem;
}

.clip-view-info {
    padding: 0 0.25rem;
}

.clip-view-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.clip-view-horse {
    font-weight: 400;
    color: var(--text-secondary);
}

.clip-view-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.clip-view-meta-separator {
    color: var(--text-muted);
}

.clip-view-message {
    text-align: center;
    padding: 4rem 1.5rem;
    max-width: 480px;
    margin: 0 auto;
}

.clip-view-message h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem;
}

.clip-view-message p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.clip-view-message-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.clip-view-message-icon--error {
    background: var(--danger-bg);
    color: var(--danger);
}

.clip-view-message-icon--warning {
    background: var(--warning-bg);
    color: var(--warning);
}

/* --- Share Link in Admin --- */

.share-link-group {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}

.share-link-group .form-control {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    max-width: 220px;
}

@media (max-width: 768px) {
    .clip-view-message {
        padding: 2rem 1rem;
    }

    .share-link-group .form-control {
        max-width: 160px;
    }
}

/* ============================================================
   CIBLU COMPONENT CLASSES
   Used across Videos, VideosRider, VideosHorse, Live pages
   ============================================================ */

.ciblu-alert {
    background: rgba(var(--ciblu-primary-rgb), 0.06);
    border: 1px solid rgba(var(--ciblu-primary-rgb), 0.12);
    color: var(--text-primary);
    border-radius: var(--radius-md);
}

.ciblu-badge {
    background: var(--color-primary);
    color: #fff;
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.ciblu-badge-soft {
    background: rgba(var(--ciblu-primary-rgb), 0.10);
    color: var(--color-primary);
    border: 1px solid rgba(var(--ciblu-primary-rgb), 0.20);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.ciblu-empty-state {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.ciblu-link {
    color: var(--color-accent);
    transition: color var(--transition-fast);
}

.ciblu-link:hover {
    color: var(--color-primary);
}

.ciblu-icon-inline {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 0.125rem;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.ciblu-link:hover .ciblu-icon-inline {
    opacity: 1;
}

.ciblu-thumb-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: var(--surface-alt);
}

/* --- Play Overlay on Thumbnail --- */
.ciblu-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay);
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.ciblu-thumb-wrap:hover .ciblu-play-overlay,
.ciblu-thumb-wrap:focus-within .ciblu-play-overlay {
    opacity: 1;
}

@media (hover: none) {
    .ciblu-play-overlay {
        opacity: 0.6;
    }
}

.ciblu-play-overlay svg {
    width: 48px;
    height: 48px;
    color: #fff;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

/* --- Compact Download Buttons --- */
.ciblu-btn-download {
    min-width: 2.5rem;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

/* ── Legal pages (Datenschutz, Impressum) ── */

.legal-content {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow-sm);
}

.legal-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.legal-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 0.75rem;
}

.legal-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.5rem;
}

.legal-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.25rem 0 0.5rem;
}

.legal-content p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.legal-content ul {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-content li {
    margin-bottom: 0.5rem;
}

.legal-content a {
    color: var(--color-primary);
    text-decoration: underline;
}

.legal-content a:hover {
    color: var(--color-accent);
}

@media (max-width: 768px) {
    .legal-content {
        padding: 1.5rem 1.25rem;
    }
}

/* ============================================================
   UTILITY CLASSES (replacing recurring inline styles)
   ============================================================ */

/* --- Max-Width Utilities --- */
.mw-120 { max-width: 120px; }
.mw-150 { max-width: 150px; }
.mw-160 { max-width: 160px; }
.mw-200 { max-width: 200px; }
.mw-600 { max-width: 600px; }

/* --- Cursor --- */
.cursor-pointer { cursor: pointer; }

/* --- Scrollable Container --- */
.scrollable-sm { max-height: 400px; overflow-y: auto; }

/* --- Compact Table --- */
.table-compact { font-size: 0.85rem; }
.table-compact-xs { font-size: 0.8rem; }

/* --- Image Thumbnails (admin logos, sponsors) --- */
.img-thumb-sm { max-height: 30px; max-width: 60px; }
.img-thumb-md { max-height: 40px; max-width: 120px; }
.img-thumb-lg { max-height: 60px; max-width: 200px; }
.img-thumb-xl { max-height: 80px; max-width: 300px; }

/* --- Drag Handle (disabled state) --- */
.drag-handle-disabled { opacity: 0.3; cursor: default; }

/* --- Inline Button Compact --- */
.btn-compact { font-size: 0.7rem; }

/* ============================================================
   ANALYTICS
   ============================================================ */

.analytics-kpi-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.analytics-kpi-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: var(--shadow-sm);
}

.analytics-kpi-card--accent {
    border-left: 3px solid var(--color-accent);
}

.analytics-kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.1;
}

.analytics-kpi-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.analytics-chart-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.analytics-chart-svg {
    width: 100%;
    height: auto;
    display: block;
}

.analytics-chart-grid {
    stroke: var(--border-subtle);
    stroke-width: 1;
}

.analytics-chart-label {
    font-size: 11px;
    fill: var(--text-muted);
    font-family: system-ui, -apple-system, sans-serif;
}

.analytics-bar-pv {
    fill: var(--color-primary);
    opacity: 0.85;
    transition: opacity var(--transition-fast);
}

.analytics-bar-pv:hover {
    opacity: 1;
}

.analytics-bar-uv {
    fill: var(--color-accent);
    opacity: 0.65;
    transition: opacity var(--transition-fast);
}

.analytics-bar-uv:hover {
    opacity: 1;
}

@media (max-width: 992px) {
    .analytics-kpi-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .analytics-kpi-cards {
        grid-template-columns: 1fr;
    }

    .analytics-kpi-value {
        font-size: 1.5rem;
    }
}

/* --- Hourly Distribution Bar Chart --- */

.analytics-hourly-bar {
    fill: var(--color-accent);
    opacity: 0.75;
    transition: opacity var(--transition-fast);
}

.analytics-hourly-bar:hover {
    opacity: 1;
}


