/* ====== Fixture Detail Page ====== */
/* Only styles that supplement the template's built-in classes (style-soccer.css, custom.css). */
/* Template classes used: alc-event-header, alc-event-header--layout-2, alc-event-header__top, */
/* alc-event-header__content, alc-event-header__bottom, alc-event-header-performances, */
/* alc-event-header__performance, live-score-container, live-badge, winner-score, */
/* content-filter, content-filter__list, content-filter__item, content-filter__link, */
/* card, card__header, card__content, card--has-table, card--alt-color, */
/* widget, widget__title, widget__content, widget--sidebar, */
/* alc-table-stats, alc-table-stats--compact-sm, alc-player-info, alc-player-info__img, */
/* alc-player-info__name, alc-match-commentary, alc-commentary-cell, alc-commentary-cell--team1, */
/* alc-commentary-cell--team2, alc-commentary-cell__inner, alc-commentary-cell__text, */
/* alc-commentary-cell__icon, alc-time-stamp, alc-commentary-subheader, */
/* game-result, game-result__section, game-result__content, game-result__stats, */
/* game-result__table-stats, game-result__table-stats--soccer, game-result__stats-team-1, */
/* game-result__stats-team-2, circular, circular--size-70, circular__bar, circular__percents, */
/* circular__label, progress-stats, progress__label, progress__bar, progress__bar--success, */
/* progress__number, progress-double-container, progress-double-wrapper, progress-inner-holder, */
/* progress__double, progress__digit, progress__digit--left, progress__digit--right, */
/* progress__digit--highlight, progress--lg, progress-title, progress-title--lg, */
/* alc-event-info, alc-event-info__item, alc-event-info__value, */
/* alc-formation, alc-formation__field, alc-formation__field--bg-2, alc-formation__player-name, */
/* table-wrap-bordered, table-thead-color, icon-svg */

/* ====== Header Fixes ====== */

/* Score should be bigger in the fixture header */
.alc-event-header .score-container .score {
    font-size: 3em;
    vertical-align: middle;
    font-weight: bold;
}

/* Performance indicators should not be cropped */
.alc-event-header__bottom {
    overflow: visible;
}
.alc-event-header__bottom .container,
.alc-event-header__bottom .row,
.alc-event-header__bottom .col-6,
.alc-event-header-performances {
    overflow: visible;
}

/* ====== Prediction Status Icons ====== */
.prediction-status-icon {
    margin-left: 8px;
    font-size: 0.9em;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.prediction-status-icon.success {
    color: #1f9d55;
}

.prediction-status-icon.fail {
    color: #d64545;
}

/* ====== Player Stats Card (matches Blazor PlayerStatsCard.razor) ====== */
.player-stats-card {
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-family: 'Montserrat', sans-serif;
    width: 400px;
    max-width: 100%;
    margin: auto;
    padding: 20px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

@media (max-width: 420px) {
    .player-stats-card {
        width: calc(100% - 32px);
        padding: 16px;
        margin: 0 auto;
    }
}

.player-stats-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.player-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    position: relative;
}

.player-name-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    text-transform: uppercase;
}

.player-name {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

.player-name-main {
    font-size: 24px;
    font-weight: 800;
    color: #3498db;
}

.player-stats-header .divider {
    position: absolute;
    bottom: -8px;
    left: 0;
    width: calc(100% - 56px);
    height: 1px;
    background-color: #e0e0e0;
}

.player-club {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #7f8c8d;
    margin-top: 16px;
}

.player-stats-grid {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
    padding: 8px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.player-stats-grid .stat-item {
    text-align: center;
    flex: 1;
}

.player-stats-grid .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
}

.player-stats-grid .stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #95a5a6;
    text-transform: uppercase;
    line-height: 1.2;
}

.rating-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    min-width: 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rating-excellent {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
}

.rating-good {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

.rating-average {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.rating-poor {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

@media (max-width: 420px) {
    .player-name {
        font-size: 15px;
    }

    .player-name-main {
        font-size: 20px;
    }

    .player-club {
        font-size: 12px;
        margin-top: 12px;
    }

    .player-stats-grid {
        margin-top: 12px;
        padding: 6px;
    }

    .player-stats-grid .stat-value {
        font-size: 17px;
    }

    .player-stats-grid .stat-label {
        font-size: 10px;
    }

    .rating-badge {
        padding: 3px 8px;
        font-size: 12px;
        min-width: 35px;
    }

    .player-stats-header .divider {
        width: calc(100% - 50px);
    }
}

/* ====== Player Stats Card — supplemental styles (matches Blazor PlayerStatsCard.razor) ====== */
.player-stats-card .country-flag {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.player-photo-wrapper {
    position: relative;
    display: inline-block;
}

.player-stats-card .club-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.player-stats-card .progress-double-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding: 0 16px;
}

.player-stats-card .progress-title {
    font-size: 12px;
    font-weight: 600;
    color: #7f8c8d;
    margin-right: 8px;
    text-align: left;
    flex: 1;
}

.player-stats-card .progress {
    width: 100%;
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    flex: 3;
}

.player-stats-card .progress__bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    transition: width 0.6s ease;
    border-radius: 4px;
}

.player-stats-card .progress__bar--success {
    background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
}

.progress-percentage {
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
    margin-left: 8px;
    text-align: right;
    flex: 1;
}

@media (max-width: 420px) {
    .player-stats-card .country-flag {
        width: 50px;
        height: 50px;
    }

    .player-stats-card .club-logo {
        width: 20px;
        height: 20px;
    }

    .player-stats-card .progress-double-wrapper {
        margin-top: 12px;
        padding: 0 12px;
    }

    .player-stats-card .progress-title {
        font-size: 11px;
    }

    .progress-percentage {
        font-size: 11px;
    }
}

/* ====== Team Players Section (matches Blazor TeamStatsComponent) ====== */
.team-players-section {
    display: flex;
    gap: 32px;
    justify-content: space-between;
    margin: 24px 0;
}

@media (max-width: 768px) {
    .team-players-section {
        flex-direction: column;
        gap: 24px;
    }
}

.team-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.team-header {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    padding: 12px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%);
    border-radius: 8px;
    margin-bottom: 8px;
}

.team-column-empty {
    text-align: center;
    padding: 18px 12px;
    border: 1px dashed rgba(44, 62, 80, 0.25);
    border-radius: 8px;
    color: #6f7f8f;
    background: rgba(44, 62, 80, 0.03);
    font-size: 13px;
    line-height: 1.4;
}

/* ====== Spider Graph Section (matches Blazor TeamStatsSpiderGraphComponent) ====== */
.plotly-ts-stat-selection-btn {
    border-width: 0px;
    color: #FFFFFF;
    margin: 3px;
    transition: all 0.2s ease;
    padding: 6px 12px;
    font-size: 11px;
}

.plotly-ts-stat-selection-btn.selected {
    background-color: rgba(159, 233, 0, 0.2) !important;
    border-color: #9fe900 !important;
}

.plotly-ts-spider-graph-wrapper {
    height: 500px;
    width: 100%;
    position: relative;
    overflow: visible;
    margin-top: 20px;
}

@media (max-width: 600px) {
    .plotly-ts-spider-graph-wrapper {
        height: 360px;
        margin-top: 15px;
    }

    .plotly-ts-stat-selection-btn {
        font-size: 10px;
        padding: 4px 8px;
        margin: 2px;
    }
}

.plotly-ts-selection-section {
    margin-bottom: 16px;
}

.plotly-ts-selection-section h6 {
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    color: #85a9c3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plotly-ts-tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
    align-items: flex-start;
}

.plotly-ts-stat-actions {
    display: inline-block;
    margin-left: 10px;
}

.plotly-ts-stat-action-btn {
    font-size: 10px;
    padding: 2px 8px;
    margin: 0 2px;
    background: transparent;
    border: 1px solid rgba(133, 169, 195, 0.3);
    color: #85a9c3;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.plotly-ts-stat-action-btn:hover {
    background: rgba(159, 233, 0, 0.1);
    border-color: #9fe900;
    color: #9fe900;
}

.plotly-ts-stat-action-btn.active {
    background: rgba(159, 233, 0, 0.2);
    border-color: #9fe900;
    color: #9fe900;
}

.plotly-ts-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #85a9c3;
}

/* ====== Ballchemist Tooltip ====== */
.bc-tooltip-wrapper .bc-tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 1000;
    background-color: #1e2024;
    color: #c8cdcf;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
    width: 280px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: opacity 0.2s ease, visibility 0.2s ease;
    font-weight: normal;
    pointer-events: none;
}

.bc-tooltip-wrapper:hover .bc-tooltip-text,
.bc-tooltip-wrapper:focus .bc-tooltip-text,
.bc-tooltip-wrapper:active .bc-tooltip-text {
    visibility: visible;
    opacity: 1;
}

@media (max-width: 767px) {
    .bc-tooltip-wrapper .bc-tooltip-text {
        width: 220px;
        right: -10px;
    }
}

/* ====== Position Performance Heatmap ====== */
.position-heatmap-pitch {
    margin: auto;
    position: relative;
    max-width: 80%;
    height: 350px;
    background: linear-gradient(180deg, #4a7c4a 0%, #3a6a3a 100%);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 0 100px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    aspect-ratio: 2/1;
}

.position-sections-container {
    margin: auto;
    position: absolute;
    top: 3%;
    left: 2%;
    right: 2%;
    bottom: 3%;
    display: flex;
    flex-direction: row;
    z-index: 10;
    gap: 0;
    width: 96%;
    height: 92%;
    box-sizing: border-box;
}

.position-section {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    flex: 1 1 25%;
    height: 100%;
    min-width: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.position-section:hover {
    filter: brightness(1.15) saturate(1.2);
    box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.3), 0 0 15px rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

.position-label {
    position: relative;
    z-index: 15;
    text-align: center;
    pointer-events: none;
    padding: 0;
}

.position-name {
    color: #FFFFFF;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 6px;
    letter-spacing: 1px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.5);
    font-family: 'Montserrat', sans-serif;
}

.position-rating {
    color: #FFFFFF;
    font-weight: bold;
    font-size: 24px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.5);
    font-family: 'Montserrat', sans-serif;
}

.formation-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #31404b;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.player-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: #f8f9fa;
    border-radius: 2px;
    font-size: 12px;
    gap: 8px;
}

.player-detail-name {
    font-weight: 600;
    color: #31404b;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-detail-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.player-detail-minutes {
    color: #666;
    font-size: 11px;
}

.player-detail-rating {
    color: #38a9ff;
    font-weight: 600;
}

.position-tooltip {
    position: fixed;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 10000;
    width: 380px;
    max-height: 75vh;
    overflow-y: auto;
}

.position-tooltip-content {
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .position-section:active {
        transform: scale(0.98);
        filter: brightness(1.1);
    }

    .position-section:hover {
        transform: none;
    }

    .position-sections-container {
        margin: auto;
        top: 2%;
        left: 2%;
        right: 2%;
        bottom: 4%;
        width: 96%;
        height: 92%;
    }

    .position-heatmap-pitch {
        max-width: 100%;
        height: 250px;
    }

    .position-name {
        font-size: 12px !important;
    }

    .position-rating {
        font-size: 16px !important;
    }

    .formation-legend {
        font-size: 9px !important;
    }

    .legend-color {
        width: 8px !important;
        height: 8px !important;
    }

    .position-tooltip {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 90vw !important;
        max-width: 400px !important;
        max-height: 80vh !important;
    }

    .position-tooltip {
        animation: slideUpFadeIn 0.3s ease-out;
    }

    .player-detail-row {
        padding: 8px 12px;
        font-size: 13px;
        margin-bottom: 6px;
    }

    .player-detail-name {
        font-size: 13px;
    }

    .player-detail-minutes {
        font-size: 12px;
    }

    .player-detail-rating {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .position-sections-container {
        top: 2%;
        left: 2%;
        right: 2%;
        bottom: 4%;
        width: 96%;
        height: 92%;
    }

    .position-heatmap-pitch {
        height: 220px;
    }

    .position-name {
        font-size: 10px !important;
    }

    .position-rating {
        font-size: 14px !important;
    }

    .player-detail-row {
        padding: 4px 8px;
        font-size: 11px;
    }

    .player-detail-minutes {
        font-size: 10px;
    }
}

@media (min-width: 1200px) {
    .position-sections-container {
        top: 3%;
        left: 2%;
        right: 2%;
        bottom: 3%;
        width: 96%;
        height: 92%;
    }

    .position-heatmap-pitch {
        max-width: 70%;
        height: 400px;
    }
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ====== Match Report (facts-list) ====== */
.facts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.facts-list__item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 0;
    border-bottom: 1px solid #edf1f5;
}

.facts-list__item:last-child {
    border-bottom: none;
}

.facts-list__icon {
    width: 32px;
    height: 32px;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.facts-list__text {
    color: #31404b;
    font-weight: 600;
    word-break: break-word;
}

.facts-list__meta {
    display: block;
    color: #6c757d;
    font-weight: 500;
    font-size: 0.85rem;
    margin-top: 2px;
}
