/* =================================
   PAGE LIVE - Match en direct
   Theme MHB - Variables CSS natives
   ================================= */

/* Hero Live */
.mhb-live-hero {
    width: calc(100% - var(--mhb-bleed-margin) * 2);
    margin: 0 var(--mhb-bleed-margin);
}

.mhb-live-hero__image {
    width: 100%;
    position: relative;
    min-height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url('../images/section-bg-news.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.mhb-live-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding-top: 100px;
    padding-bottom: 30px;
}

/* Status Bar */
.mhb-live-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.mhb-live-badge-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mhb-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e74c3c;
    padding: 8px 16px;
    border-radius: 4px;
    font-family: var(--mhb-font-display);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mhb-text-white);
}

.mhb-live-badge .pulse {
    width: 10px;
    height: 10px;
    background: var(--mhb-text-white);
    border-radius: 50%;
    animation: mhbLivePulse 1.5s infinite;
}

@keyframes mhbLivePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.mhb-live-badge.finished {
    background: var(--mhb-text-gray);
}

.mhb-live-badge.finished .pulse {
    animation: none;
    opacity: 0.5;
}

.mhb-live-badge.halftime {
    background: #f39c12;
}

.mhb-live-badge.scheduled {
    background: var(--mhb-secondary);
}

.mhb-live-badge.scheduled .pulse {
    animation: none;
    opacity: 0.5;
}

.mhb-live-competition {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.mhb-live-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.mhb-live-refresh__icon {
    display: flex;
    align-items: center;
}

.mhb-live-refresh__countdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    font-family: var(--mhb-font-display);
    font-weight: 700;
    color: var(--mhb-text-white);
}

/* Scoreboard */
.mhb-live-scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 20px;
}

.mhb-live-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mhb-live-team--home {
    justify-content: center;
}

.mhb-live-team--visitor {
    justify-content: center;
}

.mhb-live-team__logo {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.mhb-live-team__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.mhb-live-team__name {
    font-family: var(--mhb-font-display);
    font-size: 1.6rem;
    font-weight: 400;
    text-transform: uppercase;
    color: var(--mhb-text-white);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.mhb-live-score {
    text-align: center;
    padding: 0 20px;
}

.mhb-live-score__main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.mhb-live-score__value {
    font-family: var(--mhb-font-display);
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    color: var(--mhb-text-white);
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    transition: all var(--mhb-transition-base);
}

.mhb-live-score__value.score-updated {
    animation: mhbScoreFlash 0.6s ease;
}

@keyframes mhbScoreFlash {
    0%, 100% { color: var(--mhb-text-white); transform: scale(1); }
    50% { color: var(--mhb-secondary); transform: scale(1.15); }
}

.mhb-live-score__separator {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 300;
}

.mhb-live-score__details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
}

.mhb-live-score__period {
    font-family: var(--mhb-font-display);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
    padding: 4px 14px;
    border-radius: 4px;
}

.mhb-live-score__time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mhb-font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--mhb-secondary);
}

.mhb-live-score__time-icon {
    display: flex;
    align-items: center;
    opacity: 0.7;
}

/* Match Info */
.mhb-live-match-info {
    text-align: center;
}

.mhb-live-stadium {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
}

.mhb-live-media {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.mhb-live-media__logo {
    height: 24px;
    width: auto;
}

.mhb-live-media__link {
    color: var(--mhb-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.mhb-live-media__link:hover {
    text-decoration: underline;
}

/* Onglets */
.mhb-live-tabs {
    background: var(--mhb-bg-dark-alt);
    padding: 0;
}

.mhb-live-tabs__nav {
    display: flex;
    gap: 5px;
}

.mhb-live-tabs__btn {
    flex: 1;
    padding: 15px 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--mhb-font-display);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--mhb-transition-fast);
    position: relative;
}

.mhb-live-tabs__btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: background var(--mhb-transition-fast);
}

.mhb-live-tabs__btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
}

.mhb-live-tabs__btn.active {
    color: var(--mhb-text-white);
}

.mhb-live-tabs__btn.active::after {
    background: var(--mhb-accent);
}

/* Contenu */
.mhb-live-content {
    padding: 40px 0 60px;
}

.mhb-live-tab {
    display: none;
}

.mhb-live-tab.active {
    display: block;
    animation: mhbLiveFadeIn 0.3s ease;
}

@keyframes mhbLiveFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mhb-live-loading,
.mhb-live-no-data {
    text-align: center;
    padding: 40px;
    color: var(--mhb-text-gray);
    font-size: 1rem;
}

/* Spinner */
.mhb-live-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--mhb-secondary);
    border-radius: 50%;
    animation: mhbLiveSpin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes mhbLiveSpin {
    to { transform: rotate(360deg); }
}

/* Stats Grid */
.mhb-live-stats {
    max-width: 800px;
    margin: 0 auto;
}

.mhb-live-stat-row {
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    gap: 20px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mhb-live-stat-value {
    font-family: var(--mhb-font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--mhb-text-white);
}

.mhb-live-stat-home {
    text-align: right;
    color: var(--mhb-secondary);
}

.mhb-live-stat-visitor {
    text-align: left;
}

.mhb-live-stat-bar-container {
    text-align: center;
}

.mhb-live-stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
}

.mhb-live-stat-bar {
    display: flex;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.mhb-live-stat-bar__fill {
    transition: width 0.5s ease;
}

.mhb-live-stat-bar__fill--home {
    background: linear-gradient(90deg, var(--mhb-secondary), #3b8dd4);
}

.mhb-live-stat-bar__fill--visitor {
    background: linear-gradient(90deg, #5a6096, #7a84b6);
}

/* Barres de pourcentage */
.mhb-live-stat-bar--percent {
    position: relative;
}

.mhb-live-stat-bar--percent::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    z-index: 0;
}

.mhb-live-stat-bar__fill--percent {
    position: relative;
    z-index: 1;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

/* Stats inversees (pertes de balle) */
.mhb-live-stat-row--inverse .mhb-live-stat-bar__fill--home {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.mhb-live-stat-row--inverse .mhb-live-stat-bar__fill--visitor {
    background: linear-gradient(90deg, #e67e22, #d35400);
}

/* Events Timeline */
.mhb-live-events {
    max-width: 800px;
    margin: 0 auto;
}

.mhb-live-timeline {
    position: relative;
}

.mhb-live-event {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    margin-bottom: 8px;
    background: var(--mhb-bg-glass);
    border-radius: var(--mhb-radius-sm);
    border-left: 3px solid var(--mhb-secondary);
    transition: background var(--mhb-transition-fast);
}

.mhb-live-event:hover {
    background: rgba(255, 255, 255, 0.05);
}

.mhb-live-event--visitor {
    border-left-color: #5a6096;
}

.mhb-live-event--goal {
    background: rgba(46, 204, 113, 0.08);
    border-left-color: #2ecc71;
}

.mhb-live-event--2min {
    background: rgba(243, 156, 18, 0.08);
    border-left-color: #f39c12;
}

.mhb-live-event__time {
    font-family: var(--mhb-font-display);
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 40px;
    color: var(--mhb-accent);
    text-align: center;
}

.mhb-live-event__team-logo {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.mhb-live-event__team-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mhb-live-event__icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
}

.mhb-live-event__content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.mhb-live-event__photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.mhb-live-event__details {
    flex: 1;
    min-width: 0;
}

.mhb-live-event__player {
    display: block;
    font-weight: 600;
    color: var(--mhb-text-white);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mhb-live-event__desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    display: block;
}

.mhb-live-event__score {
    font-family: var(--mhb-font-display);
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
    white-space: nowrap;
}

/* Players Section */
.mhb-live-players {
    max-width: 900px;
    margin: 0 auto;
}

.mhb-live-players__title {
    font-family: var(--mhb-font-display);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    margin: 25px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mhb-live-players__title:first-child {
    margin-top: 0;
}

/* Players Grid */
.mhb-live-players__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.mhb-live-player {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: var(--mhb-bg-glass);
    border: 1px solid var(--mhb-border-glass);
    border-radius: var(--mhb-radius-sm);
    transition: all var(--mhb-transition-fast);
}

.mhb-live-player:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.mhb-live-player__photo {
    position: relative;
    width: 60px;
    height: 60px;
}

.mhb-live-player__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.mhb-live-player__number {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: var(--mhb-secondary);
    border-radius: 50%;
    font-family: var(--mhb-font-display);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mhb-text-white);
    border: 2px solid var(--mhb-bg-dark-alt);
}

.mhb-live-player__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.mhb-live-player__name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--mhb-text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mhb-live-player__position {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.mhb-live-player__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.mhb-live-player-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    min-width: 45px;
}

.mhb-live-player-stat__val {
    font-family: var(--mhb-font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--mhb-text-white);
}

.mhb-live-player-stat__lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.5px;
}

.mhb-live-player-stat--main {
    background: rgba(46, 204, 113, 0.15);
}

.mhb-live-player-stat--main .mhb-live-player-stat__val {
    color: #2ecc71;
}

.mhb-live-player-stat--warn {
    background: rgba(243, 156, 18, 0.15);
}

.mhb-live-player-stat--warn .mhb-live-player-stat__val {
    color: #f39c12;
}

.mhb-live-player-stat--success {
    background: rgba(46, 204, 113, 0.15);
}

.mhb-live-player-stat--success .mhb-live-player-stat__val {
    color: #2ecc71;
}

.mhb-live-player-stat--danger {
    background: rgba(231, 76, 60, 0.15);
}

.mhb-live-player-stat--danger .mhb-live-player-stat__val {
    color: #e74c3c;
}

/* Animation flash stats joueurs */
.mhb-live-player-stat--flash {
    animation: mhbStatFlash 1s ease;
}

@keyframes mhbStatFlash {
    0% { background: rgba(46, 204, 113, 0.4); transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Animation nouveaux événements */
.mhb-live-event--new {
    animation: mhbEventSlideIn 0.6s ease;
}

@keyframes mhbEventSlideIn {
    0% { opacity: 0; transform: translateY(-15px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Carte gardien */
.mhb-live-player--goalkeeper {
    border-color: rgba(46, 204, 113, 0.3);
    background: rgba(46, 204, 113, 0.05);
}

.mhb-live-player--goalkeeper .mhb-live-player__number {
    background: #2ecc71;
}

/* Joueur non entre en jeu */
.mhb-live-player--bench {
    opacity: 0.5;
}

/* Update Notification */
.mhb-live-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #2ecc71;
    color: var(--mhb-text-white);
    padding: 12px 24px;
    border-radius: var(--mhb-radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--mhb-shadow-lg);
    opacity: 0;
    transition: all var(--mhb-transition-base);
    z-index: 1000;
}

.mhb-live-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Admin Bar */
.mhb-live-admin {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 0;
    z-index: 1000;
}

.mhb-live-admin__inner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mhb-live-admin__label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mhb-accent);
    background: rgba(233, 83, 35, 0.2);
    padding: 4px 8px;
    border-radius: 3px;
}

.mhb-live-admin__info {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    flex: 1;
}

.mhb-live-admin__info .source-live {
    color: #2ecc71;
    font-weight: 600;
}

.mhb-live-admin__info .source-error {
    color: #e74c3c;
    font-weight: 600;
}

.mhb-live-admin__info .source-loading {
    color: var(--mhb-text-gray);
}

/* No match content */
.mhb-live-no-match {
    text-align: center;
    padding: 60px 20px;
    max-width: 500px;
    margin: 0 auto;
}

.mhb-live-no-match p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* =================================
   RESPONSIVE - Tablet (1024px)
   ================================= */
@media (max-width: 1024px) {
    .mhb-live-hero {
        width: 100%;
        margin: 0;
    }
}

/* =================================
   RESPONSIVE - Mobile (768px)
   ================================= */
@media (max-width: 768px) {
    .mhb-live-hero {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }

    .mhb-live-hero__image {
        width: 100%;
        max-width: 100%;
        min-height: auto;
    }

    .mhb-live-hero__overlay {
        position: relative;
        width: 100%;
        padding: 120px 15px 30px;
    }

    .mhb-live-status {
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }

    .mhb-live-scoreboard {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "home visitor"
            "score score";
        gap: 15px;
        text-align: center;
    }

    .mhb-live-team--home {
        grid-area: home;
        flex-direction: column-reverse;
    }

    .mhb-live-team--visitor {
        grid-area: visitor;
        flex-direction: column-reverse;
    }

    .mhb-live-team {
        gap: 8px;
    }

    .mhb-live-team__logo {
        width: 55px;
        height: 55px;
    }

    .mhb-live-team__name {
        font-size: 1rem;
    }

    .mhb-live-score {
        grid-area: score;
        padding: 0;
    }

    .mhb-live-score__value {
        font-size: 3.5rem;
    }

    .mhb-live-tab.active {
        padding-left: 10px;
        padding-right: 10px;
    }

    .mhb-live-tabs__nav {
        flex-wrap: wrap;
    }

    .mhb-live-tabs__btn {
        flex: 1 1 45%;
        padding: 12px 10px;
        font-size: 0.8rem;
    }

    .mhb-live-stat-row {
        grid-template-columns: 60px 1fr 60px;
        gap: 10px;
    }

    .mhb-live-stat-value {
        font-size: 1.2rem;
    }

    .mhb-live-players__grid {
        grid-template-columns: 1fr;
    }

    .mhb-live-player {
        grid-template-columns: 50px 1fr;
    }

    .mhb-live-player__stats {
        grid-column: 1 / -1;
        justify-content: flex-start;
        margin-top: 10px;
    }

    .mhb-live-admin__inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .mhb-live-admin__info {
        width: 100%;
        text-align: center;
        order: -1;
        margin-bottom: 10px;
    }
}

/* =================================
   RESPONSIVE - Mobile Small (576px)
   ================================= */
@media (max-width: 576px) {
    .mhb-live-score__value {
        font-size: 3rem;
    }

    .mhb-live-event {
        padding: 10px;
        gap: 8px;
    }

    .mhb-live-event__photo {
        width: 32px;
        height: 32px;
    }
}
