/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    header {
        padding: 20px;
        border-radius: 16px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .header-top {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .theme-toggle {
        align-self: flex-end;
        margin-top: -50px;
    }
    
    .controls {
        gap: 12px;
    }
    
    .date-selector {
        flex-direction: column;
    }
    
    .filters {
        justify-content: stretch;
    }
    
    .filter-btn {
        flex: 1;
        justify-content: center;
    }
    
    .stats-bar {
        padding: 16px;
        border-radius: 12px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .matches-container {
        grid-template-columns: 1fr;
        padding: 0px;
        gap: 12px;
    }
    
    .match-card {
        padding: 16px;
    }
    
    .team-logo {
        width: 48px;
        height: 48px;
    }
    
    .team-name {
        font-size: 0.8rem;
    }
    
    .match-score {
        font-size: 1.75rem;
    }
    
    .league-header {
        padding: 14px 16px;
    }
    
    .league-info {
        gap: 10px;
    }
    
    .league-icon {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .league-name {
        font-size: 0.9rem;
    }
    
    .league-country {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .match-teams {
        flex-direction: column;
        gap: 12px;
    }
    
    .team {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .team-logo {
        margin-bottom: 0;
        margin-right: 12px;
    }
    
    .team-name {
        text-align: left;
        flex: 1;
    }
    
    .vs {
        order: -1;
        margin-bottom: 8px;
    }
    
    .match-score {
        order: -1;
        margin-bottom: 16px;
    }

    
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .search-filter-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .country-filter {
        min-width: auto;
        width: 100%;
    }
    
    .country-header {
        padding: 16px;
    }
    
    .country-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .country-name {
        font-size: 1.1rem;
    }
}

/* Mobile Responsive for Modal */
@media (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .round-header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .round-matches {
        padding: 12px 16px;
    }
    
    .fixture-match-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .fixture-teams {
        flex-direction: column;
        gap: 12px;
    }
    
    .fixture-team {
        justify-content: flex-start !important;
        flex-direction: row;
    }
    
    .fixture-team.away-team {
        flex-direction: row;
    }
    
    .fixture-score {
        order: -1;
        margin-bottom: 8px;
    }
    
    .league-actions {
        gap: 6px;
    }
    
    .fixtures-btn {
        padding: 6px;
        font-size: 0.8rem;
    }
}


/* Mobile Responsive for Round Selector */
@media (max-width: 768px) {
    .round-selector-container {
        padding: 16px;
    }
    
    .round-selector {
        gap: 8px;
    }
    
    .round-nav-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .round-select {
        padding: 8px 12px;
        min-width: 140px;
        font-size: 0.85rem;
    }
    
    .fixture-date-info {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    .fixture-teams {
        gap: 12px;
    }
    
    .team-info {
        align-items: center !important;
        text-align: center;
    }
}


/* Mobile Responsive for Standings */
@media (max-width: 768px) {
    .standings-modal .modal-content {
        margin: 10px;
    }
    
    .standings-header {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .season-info {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .current-round, .total-rounds, .teams-count {
        width: 100%;
        text-align: center;
    }
    
    .standings-table {
        font-size: 0.8rem;
    }
    
    .standings-table th,
    .standings-table td {
        padding: 8px 4px;
    }
    
    .team-col { width: 150px; }
    .stats-col { width: 40px; }
    .form-col { width: 80px; }
    
    .team-info {
        gap: 6px;
    }
    
    .team-logo-xs {
        width: 20px;
        height: 20px;
    }
    
    .team-name {
        font-size: 0.8rem;
    }
    
    .form-dot {
        width: 6px;
        height: 6px;
    }
    
    .standings-rules {
        padding: 16px;
    }
    
    .league-actions {
        gap: 4px;
    }
    
    .standings-btn, .fixtures-btn {
        padding: 6px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .standings-table {
        font-size: 0.75rem;
    }
    
    .team-col { width: 120px; }
    
    .standings-table th:nth-child(n+7),
    .standings-table td:nth-child(n+7) {
        display: none;
    }
}


/* Support pour l'orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .date-navigation {
        margin-bottom: 6px;
    }
    
    .current-date-display {
        margin: 4px 0 10px 0;
        font-size: 14px;
    }
    
    .nav-btn {
        padding: 6px 8px;
        height: 36px;
    }
}


/* Score pour mobile (affiché séparément en bas) */
.match-score-mobile {
    display: none;
    justify-content: center;
    align-items: center; /* Centrer verticalement */
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    min-height: 40px;
}

/* Media Queries pour l'affichage responsive */

/* Mobile (écrans jusqu'à 768px) */
@media (max-width: 768px) {
    .match-score-desktop {
        display: none;
    }
    
    .team-score-right {
        display: flex; /* Afficher le score à droite */
    }
    
    .match-teams {
        flex-direction: column;
        gap: 12px;
    }
    
    .team {
        justify-content: space-between;
    }
    
    .team-info {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex: 1;
    }
    
    .team-name-wrapper {
        flex: 1;
    }
    
    .team-cards {
        margin-top: 2px;
    }
    
    .match-score-mobile {
        display: none; /* On utilise l'affichage avec score à droite */
    }
}

/* Desktop (écrans à partir de 769px) */
@media (min-width: 769px) {
    .team-score-right {
        display: none; /* Caché sur desktop, on utilise le score central */
    }
    
    .match-score-desktop {
        display: flex;
    }
    
    .match-score-mobile {
        display: none;
    }
}

/* Pour les écrans moyens (tablettes) */
@media (min-width: 481px) and (max-width: 768px) {
    .team {
        min-height: 60px; /* Plus d'espace pour l'alignement vertical */
    }
    
    .team-score-right {
        min-width: 45px;
        min-height: 45px;
    }
    
    .team-score-right .score {
        font-size: 22px;
    }
}

/* Pour les petits mobiles (écrans jusqu'à 480px) */
@media (max-width: 480px) {
    .team-name {
        font-size: 14px;
    }
    
    .team-score-right {
        min-width: 35px;
        min-height: 35px;
        margin-left: 10px;
    }
    
    .team-score-right .score {
        font-size: 18px;
    }
    
    .team-cards {
        font-size: 11px;
    }
}

/* Pour les écrans très étroits (moins de 360px) */
@media (max-width: 360px) {
    .team-score-right {
        display: none; /* Cacher le score à droite */
    }
    
    .match-score-mobile {
        display: flex; /* Afficher le score en bas */
    }
    
    .team-info {
        justify-content: flex-start;
    }
    
    .team {
        min-height: auto;
    }
}