/* ============================================= */
/* MIFLECHA SCOREBOARD v2.0                      */
/* css/scoreboard.css                            */
/* ============================================= */

.miflecha-scoreboard-container {
    --sb-blue: #0054A5;
    --sb-dark: #060B18;
    --sb-darker: #030710;
    --sb-red: #ED1C24;
    --sb-yellow: #FFF200;
    --sb-green: #00A651;
    --sb-gold: #FFD700;
    --sb-silver: #C0C0C0;
    --sb-bronze: #CD7F32;
    --sb-text: #ffffff;
    --sb-text-dim: #6B7FA3;
    --sb-border: rgba(0, 84, 165, 0.15);
    --sb-glow: rgba(0, 84, 165, 0.25);

    width: 100%;
    height: 420px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: var(--sb-dark);
    color: var(--sb-text);
    font-family: 'Roboto', sans-serif;
    border-radius: 14px;
    border: 1px solid var(--sb-border);
}

/* ---- FONDO ---- */
.miflecha-scoreboard-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--sb-dark);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(0, 84, 165, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(237, 28, 36, 0.08) 0%, transparent 50%);
}

/* ---- SCAN LINE (sutil) ---- */
.miflecha-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 10%, rgba(0, 84, 165, 0.5) 50%, transparent 90%);
    z-index: 5;
    opacity: 0.4;
    animation: sb-scan 4s linear infinite;
}

@keyframes sb-scan {
    0% { top: 0; opacity: 0.4; }
    50% { opacity: 0.15; }
    100% { top: 100%; opacity: 0.4; }
}

/* ---- FLECHAS DECORATIVAS (ocultas por default, ligeras) ---- */
.miflecha-animated-arrows {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.miflecha-arrow {
    position: absolute;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04), transparent);
    animation: sb-arrowMove 8s linear infinite;
    opacity: 0;
}

@keyframes sb-arrowMove {
    0% { transform: translateX(-100px); opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { transform: translateX(calc(100vw + 100px)); opacity: 0; }
}

/* ---- HEADER ---- */
.miflecha-board-header {
    background: linear-gradient(135deg, var(--sb-darker) 0%, rgba(0, 40, 80, 0.95) 100%);
    padding: 14px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--sb-border);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.miflecha-board-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.miflecha-board-title h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: var(--sb-text);
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.miflecha-board-subtitle {
    font-size: 11px;
    color: var(--sb-text-dim);
    font-weight: 400;
    letter-spacing: 1px;
}

.miflecha-digital-dots {
    display: none;
}

.miflecha-board-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.miflecha-board-live {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--sb-red);
    padding: 5px 14px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1.5px;
    background: rgba(237, 28, 36, 0.08);
    border: 1px solid rgba(237, 28, 36, 0.2);
}

.miflecha-board-live::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--sb-red);
    border-radius: 50%;
    animation: sb-liveDot 1.8s ease infinite;
}

@keyframes sb-liveDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(237, 28, 36, 0.4); }
    50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(237, 28, 36, 0); }
}

/* ---- CONTENIDO ---- */
.miflecha-board-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.miflecha-fade-top,
.miflecha-fade-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 30px;
    z-index: 10;
    pointer-events: none;
}

.miflecha-fade-top {
    top: 0;
    background: linear-gradient(to bottom, var(--sb-dark), transparent);
}

.miflecha-fade-bottom {
    bottom: 0;
    background: linear-gradient(to top, var(--sb-dark), transparent);
}

.miflecha-scroll-container {
    height: 100%;
    overflow-y: auto;
    padding: 16px 18px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 84, 165, 0.3) transparent;
    position: relative;
}

.miflecha-scroll-container::-webkit-scrollbar {
    width: 5px;
}

.miflecha-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.miflecha-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(0, 84, 165, 0.3);
    border-radius: 10px;
}

/* ---- COMPETENCIA ITEM ---- */
.miflecha-competition-item {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid var(--sb-border);
    transition: border-color 0.3s;
}

.miflecha-competition-item:last-child {
    margin-bottom: 0;
}

.miflecha-competition-item:hover {
    border-color: rgba(0, 84, 165, 0.35);
}

/* ---- COMPETENCIA HEADER ---- */
.miflecha-competition-header {
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--sb-border);
    background: linear-gradient(135deg, rgba(0, 30, 60, 0.5) 0%, rgba(0, 15, 35, 0.3) 100%);
}

.miflecha-competition-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--sb-text);
    margin: 0 0 10px 0;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.miflecha-competition-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.miflecha-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--sb-text-dim);
}

.miflecha-info-item .miflecha-icon {
    color: var(--sb-blue);
    font-size: 11px;
    opacity: 0.7;
}

/* ---- CATEGORÍAS ---- */
.miflecha-categories-container {
    padding: 14px 16px;
}

.miflecha-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.miflecha-category-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.miflecha-category-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--sb-text-dim);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- PODIUM ---- */
.miflecha-podium-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.miflecha-podium-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 6px;
    position: relative;
    transition: background 0.2s;
}

.miflecha-podium-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Medallas — línea lateral sutil */
.miflecha-podium-item.gold {
    border-left: 2px solid var(--sb-gold);
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.04) 0%, transparent 40%);
}

.miflecha-podium-item.silver {
    border-left: 2px solid var(--sb-silver);
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.03) 0%, transparent 40%);
}

.miflecha-podium-item.bronze {
    border-left: 2px solid var(--sb-bronze);
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.03) 0%, transparent 40%);
}

/* Quitar animación de shine — más limpio */
.miflecha-podium-item::after {
    display: none;
}

.miflecha-position {
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.miflecha-medal-gold {
    color: var(--sb-gold);
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.4));
}

.miflecha-medal-silver {
    color: var(--sb-silver);
    filter: drop-shadow(0 0 3px rgba(192, 192, 192, 0.3));
}

.miflecha-medal-bronze {
    color: var(--sb-bronze);
    filter: drop-shadow(0 0 3px rgba(205, 127, 50, 0.3));
}

.miflecha-athlete-name {
    flex: 2;
    font-weight: 500;
    font-size: 13px;
    color: var(--sb-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 8px;
}

.miflecha-athlete-club {
    flex: 1;
    color: var(--sb-text-dim);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.miflecha-athlete-score {
    width: 55px;
    text-align: right;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--sb-text);
    flex-shrink: 0;
}

.miflecha-podium-item.gold .miflecha-athlete-score { color: var(--sb-gold); }
.miflecha-podium-item.silver .miflecha-athlete-score { color: var(--sb-silver); }
.miflecha-podium-item.bronze .miflecha-athlete-score { color: var(--sb-bronze); }

/* ---- NO RESULTS ---- */
.miflecha-no-results {
    text-align: center;
    padding: 14px;
    color: var(--sb-text-dim);
    font-size: 12px;
}

/* ---- NO COMPETITIONS ---- */
.miflecha-no-competitions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
}

.miflecha-no-competitions .miflecha-icon {
    font-size: 36px;
    color: var(--sb-text-dim);
    margin-bottom: 16px;
    opacity: 0.4;
}

.miflecha-no-competitions h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--sb-text-dim);
    margin-bottom: 8px;
}

.miflecha-no-competitions p {
    color: var(--sb-text-dim);
    font-size: 13px;
    max-width: 380px;
    opacity: 0.6;
}

/* ---- SCROLL ARROW ---- */
.miflecha-scroll-arrow {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: var(--sb-blue);
    animation: sb-float 2.5s ease infinite;
    opacity: 0.5;
    z-index: 20;
}

@keyframes sb-float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-6px); }
}

/* ============================================= */
/* RESPONSIVE                                    */
/* ============================================= */
@media (max-width: 768px) {
    .miflecha-scoreboard-container {
        height: 360px;
    }

    .miflecha-board-header {
        padding: 12px 16px;
    }

    .miflecha-board-title h1 {
        font-size: 12px;
        letter-spacing: 2px;
    }

    .miflecha-board-live {
        font-size: 10px;
        padding: 4px 10px;
    }

    .miflecha-category-grid {
        grid-template-columns: 1fr;
    }

    .miflecha-competition-info {
        flex-direction: column;
        gap: 6px;
    }

    .miflecha-competition-title {
        font-size: 14px;
    }

    .miflecha-scroll-container {
        padding: 12px 14px;
    }

    .miflecha-podium-item {
        padding: 7px 8px;
    }

    .miflecha-athlete-club {
        display: none;
    }

    .miflecha-athlete-name {
        font-size: 12px;
    }

    .miflecha-athlete-score {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .miflecha-scoreboard-container {
        height: 320px;
        border-radius: 10px;
    }

    .miflecha-board-header {
        flex-direction: row;
        padding: 10px 14px;
    }

    .miflecha-board-title h1 {
        font-size: 11px;
    }

    .miflecha-competition-header {
        padding: 12px 14px;
    }

    .miflecha-categories-container {
        padding: 10px 12px;
    }

    .miflecha-position {
        width: 24px;
        font-size: 11px;
    }
}