/**
 * F7 League — Fixture Live Shortcodes CSS
 * Uses exact same HTML structure and CSS tokens as visualizador/gestor-visual.
 * The .visualizer-overlay (position:fixed) is shared from visualizador.css.
 * This file only adds fixture-specific component styles.
 */

/* ============================================================
   SHARED VISUALIZER STYLES (self-contained copy)
   so fixture-live works without visualizador.css on the page
============================================================ */
.f7-live-page-root .visualizer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 50%, rgba(196, 30, 58, 0.4) 0%, transparent 70%),
        linear-gradient(180deg, #0a0b10 0%, #000 100%);
    z-index: 0;
    pointer-events: none;
}

.f7-live-page-root .visualizer-main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    position: relative;
    z-index: 10;
    padding: 40px 20px;
    box-sizing: border-box;
}

.f7-live-page-root .visualizer-logo-container {
    margin-bottom: 1.5rem;
}

.f7-live-page-root .visualizer-logo-container img {
    height: 60px;
    filter: drop-shadow(0 0 15px #C41E3A);
}

/* ============================================================
   PAGE ROOT WRAPPER
============================================================ */
.f7-live-page-root {
    position: relative;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    color: #e8e8e8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

/* ============================================================
   FIXTURE CARD — matches .visualizer-card
============================================================ */
.f7-fixture-card {
    width: 90vw;
    max-width: 1100px;
    background: rgba(20, 20, 25, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 3px solid #C41E3A;
    border-radius: 24px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    animation: f7live-fadein 0.4s ease-out;
}

@keyframes f7live-fadein {
    from {
        opacity: 0;
        transform: scale(0.97);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Card Header */
.f7-fixture-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 22px 28px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.12) 0%, transparent 60%);
}

.f7-fixture-card-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

/* Card Body */
.f7-fixture-card-body {
    padding: 24px 28px;
    max-height: 72vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #C41E3A transparent;
}

.f7-fixture-card-body::-webkit-scrollbar {
    width: 5px;
}

.f7-fixture-card-body::-webkit-scrollbar-track {
    background: transparent;
}

.f7-fixture-card-body::-webkit-scrollbar-thumb {
    background: #C41E3A;
    border-radius: 3px;
}

/* ============================================================
   STATUS BADGE
============================================================ */
.f7-status-badge {
    font-size: 0.72em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid currentColor;
}

.f7-status-badge.published {
    color: #28a745;
    background: rgba(40, 167, 69, 0.12);
}

.f7-status-badge.template {
    color: #f0a820;
    background: rgba(240, 168, 32, 0.12);
}

.f7-status-badge.draft {
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

/* ============================================================
   ROUND TITLE
============================================================ */
.f7-round-title {
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #C41E3A;
    padding: 14px 0 8px;
    border-bottom: 1px solid rgba(196, 30, 58, 0.2);
    margin-bottom: 10px;
    margin-top: 18px;
}

.f7-round-title:first-child {
    margin-top: 0;
}

/* ============================================================
   MATCH GRID & CARDS
============================================================ */
.f7-fixture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    margin-bottom: 6px;
}

.f7-match-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 12px 15px;
    transition: background 0.2s;
}

.f7-match-card:hover {
    background: rgba(255, 255, 255, 0.08);
}

.f7-match-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 6px;
}

.f7-court {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.f7-match-teams {
    font-size: 0.92em;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.f7-vs {
    font-size: 0.7em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.f7-placeholder {
    font-style: italic;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
}

/* ============================================================
   INLINE EDIT (Admin)
============================================================ */
.f7-match-edit-btn {
    display: block;
    margin-top: 8px;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.72em;
    padding: 3px 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.f7-match-edit-btn:hover {
    border-color: #C41E3A;
    color: #C41E3A;
}

.f7-match-edit-form {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.f7-match-edit-form input {
    flex: 1;
    min-width: 80px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #fff;
    padding: 5px 8px;
    font-size: 0.82em;
}

.f7-match-edit-form input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.f7-match-edit-save {
    background: #C41E3A;
    border: none;
    border-radius: 6px;
    color: #fff;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.85em;
    transition: opacity 0.15s;
}

.f7-match-edit-save:hover {
    opacity: 0.85;
}

/* ============================================================
   DRAW SECTION (Admin)
============================================================ */
.f7-draw-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.f7-draw-section h3 {
    font-size: 0.85em;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 16px;
}

.f7-draw-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.f7-draw-slot {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.f7-draw-slot label {
    font-size: 0.78em;
    font-weight: 700;
    color: #C41E3A;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.f7-draw-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: #fff;
    padding: 8px 10px;
    font-size: 0.88em;
    cursor: pointer;
    transition: border-color 0.15s;
    width: 100%;
}

.f7-draw-select:hover,
.f7-draw-select:focus {
    border-color: #C41E3A;
    outline: none;
}

.f7-draw-select option {
    background: #1a1a22;
    color: #fff;
}

/* ============================================================
   ACTION BUTTONS
============================================================ */
.f7-fixture-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.f7-btn {
    padding: 9px 20px;
    border-radius: 10px;
    font-size: 0.88em;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    letter-spacing: 0.3px;
}

.f7-btn-primary {
    background: #C41E3A;
    color: #fff;
    box-shadow: 0 4px 14px rgba(196, 30, 58, 0.35);
}

.f7-btn-primary:hover {
    background: #a01830;
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.5);
}

.f7-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.f7-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #e8e8e8;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.f7-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* ============================================================
   TOAST
============================================================ */
.f7-live-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1d1f26;
    color: #fff;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border-left: 4px solid #C41E3A;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 99999;
    pointer-events: none;
    max-width: 320px;
}

.f7-live-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.f7-live-toast.success {
    border-left-color: #28a745;
}

.f7-live-toast.error {
    border-left-color: #dc3545;
}

/* ============================================================
   SPINNER
============================================================ */
.f7-live-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #C41E3A;
    border-radius: 50%;
    animation: f7live-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 600px) {
    .f7-fixture-card-header {
        padding: 16px 16px 12px;
    }

    .f7-fixture-card-body {
        padding: 16px;
    }

    .f7-fixture-grid {
        grid-template-columns: 1fr;
    }

    .f7-draw-grid {
        grid-template-columns: 1fr;
    }
}