/**
 * Styles globaux pour les widgets Club (Résultats + Calendrier)
 * Design minimaliste type tableau
 */

/* ============================================
   SHOW MORE — état masqué des items
   ============================================ */

.club-result-item.is-hidden,
.club-calendar-item.is-hidden {
    display: none;
}

/* ============================================
   BOUTON GHOST — style shadcn/ui ghost variant
   ============================================ */

.club-show-more-btn {
    padding: 16px 32px 16px 32px !important;
    width: fit-content;
    align-self: center;
    margin-top: 20px;
}

/* ============================================
   STYLES COMMUNS - DESKTOP
   ============================================ */

/* Container principal - Une seule bordure */
.club-results-container,
.club-calendar-container {
    width: auto;
    min-width: 600px;
    overflow: hidden;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Item de résultat/calendrier individuel */
.club-result-item,
.club-calendar-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.club-result-item:last-child,
.club-calendar-item:last-child {
    border-bottom: none;
}

/* Compétition et poule */
.match-category {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 0.25rem;
    text-align: center;
}

/* Contenu du match */
.match-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 58px;
}

/* Équipes */
.team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.team.home {
    justify-content: flex-end;
}

.team.away {
    justify-content: flex-start;
}

/* Nom de l'équipe */
.team-name {
    font-size: 0.875rem;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Logo de l'équipe */
.team-logo {
    width: 2.5rem;
    object-fit: contain;
    flex-shrink: 0;
}

/* Placeholder pour logo manquant */
.team-logo-placeholder {
    width: 2.5rem;
    background-color: #e5e7eb;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ============================================
   STYLES SPÉCIFIQUES - RÉSULTATS
   ============================================ */

/* Équipe gagnante en gras */
.team.winner .team-name {
    font-weight: 700;
    color: #111827;
}

/* Wrapper du score */
.match-score-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: fit-content;
    flex-shrink: 0;
}

/* Score */
.match-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.match-score .score {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}

/* Date du match (dans résultats) */
.club-results-container .match-date {
    font-size: 0.8rem;
    color: #9ca3af;
    white-space: nowrap;
}

/* Messages d'erreur et vide */
.club-results-error,
.club-results-empty {
    padding: 2.5rem;
    text-align: center;
    min-width: 600px;
}

.club-results-error p,
.club-results-empty p {
    margin: 0;
    color: #991b1b;
    font-size: 0.875rem;
}

.club-results-empty p {
    color: #4b5563;
}

/* ============================================
   STYLES SPÉCIFIQUES - CALENDRIER
   ============================================ */

/* Wrapper des infos du match (date/heure) */
.match-info-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: fit-content;
    flex-shrink: 0;
}

/* Date et heure du match */
.match-date-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.club-calendar-container .match-date {
    font-size: 0.8rem;
    color: #9ca3af;
    white-space: nowrap;
}

.match-time {
    font-size: 0.7rem;
    color: #9ca3af;
    white-space: nowrap;
}

.club-calendar-item {
    min-height: 106px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ============================================
   RESPONSIVE - TABLETTE
   ============================================ */

@media (max-width: 768px) {
    .club-results-container,
    .club-calendar-container {
        min-width: auto;
        width: 100%;
        padding: 15px 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .club-result-item,
    .club-calendar-item {
        padding: 0.5rem;
    }

    .match-content {
        gap: 0.5rem;
    }

    .team {
        gap: 0.35rem;
    }

    .team-name {
        font-size: 0.8rem;
        max-width: 150px;
    }

    .team-logo {
        width: 1.5rem;
    }

    .team-logo-placeholder {
        width: 1.5rem;
        height: 1.5rem;
    }

    .match-score .score {
        font-size: 0.9rem;
    }

    .match-category {
        font-size: 0.65rem;
    }

    /* Spécifique calendrier en tablette */
    .club-calendar-container .match-date {
        font-size: 0.75rem;
    }

    .match-time {
        font-size: 0.6rem;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 580px) {
    /* ========================================
       STYLES COMMUNS MOBILE
       ======================================== */

    .team {
        min-height: 40px;
    }

    .club-results-container,
    .club-calendar-container {
        padding: 0;
    }

    .club-result-item,
    .club-calendar-item {
        padding: 1rem 0.75rem;
        border-bottom: 1px solid #d1d5db;
    }

    .club-result-item:last-child,
    .club-calendar-item:last-child {
        border-bottom: none;
    }

    /* Compétition en haut */
    .match-category {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
        text-align: center;
        color: #9ca3af;
    }

    /* Layout vertical */
    .club-results-container .match-content,
    .club-calendar-container .match-content {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }

    /* Équipes - styles communs */
    .team {
        width: 100%;
        padding: 0;
        justify-content: center;
        gap: 0.5rem;
    }

    .team-name {
        font-size: 0.875rem;
        font-weight: 500;
    }

    .team-logo {
        width: 1.75rem;
    }

    .team-logo-placeholder {
        width: 1.75rem;
        height: 1.75rem;
    }

    /* ========================================
       ORDRE MOBILE RÉSULTATS
       Ordre: Compétition → Domicile → Date+Score → Extérieur
       ======================================== */

    /* 1. Compétition (order: 0 défaut) */

    /* 2. Équipe domicile */
    .club-results-container .team.home {
        order: 1;
        justify-content: center;
    }

    /* 3. Date + Score */
    .club-results-container .match-score-wrapper {
        order: 2;
        width: 100%;
        text-align: center;
    }

    .club-results-container .match-score {
        width: 100%;
        text-align: center;
    }

    .club-results-container .match-score .score {
        font-size: 1.5rem;
        font-weight: 700;
    }

    .club-results-container .match-date {
        color: #9ca3af;
    }

    /* 4. Équipe extérieure */
    .club-results-container .team.away {
        order: 3;
        justify-content: center;
        display: flex;
        flex-direction: row-reverse;
    }

    /* ========================================
       ORDRE MOBILE CALENDRIER
       Ordre: Compétition → Domicile → Date+Heure → Extérieur
       ======================================== */

    /* 1. Compétition (order: 0 défaut) */

    /* 2. Équipe domicile */
    .club-calendar-container .team.home {
        order: 1;
        justify-content: center;
    }

    /* 3. Date + heure */
    .club-calendar-container .match-info-wrapper {
        order: 2;
        width: 100%;
    }

    .club-calendar-container .match-date-info {
        text-align: center;
        flex-direction: row;
    }

    /* 4. Équipe extérieure */
    .club-calendar-container .team.away {
        order: 3;
        justify-content: center;
        display: flex;
        flex-direction: row-reverse;
    }
}
