* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    font-size: 2.5em;
    color: #667eea;
    margin: 0;
}

.api-counter {
    background: #f0f0f0;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1.1em;
}

.api-counter strong {
    color: #667eea;
    font-size: 1.2em;
}

/* Standings Section */
.standings-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.standings-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2em;
}

.standings-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.team-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 5px solid #667eea;
}

.team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.team-rank {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
}

.team-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.team-info {
    flex: 1;
}

.team-name {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
    color: #333;
}

.team-stats {
    font-size: 0.9em;
    color: #666;
}

/* Matches Section */
.matches-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.matches-section > h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2em;
}

.match-container {
    margin-bottom: 30px;
}

.match-container h3 {
    color: #764ba2;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.match-card {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.match-status {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.match-status.live {
    background: #e74c3c;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.match-status.finished {
    background: #27ae60;
}

.match-status.upcoming {
    background: #3498db;
}

.match-status.starting-soon {
    background: #f39c12;
    animation: glow 1.5s infinite;
}

@keyframes glow {
    0%, 100% { 
        box-shadow: 0 0 5px #f39c12, 0 0 10px #f39c12;
        opacity: 1; 
    }
    50% { 
        box-shadow: 0 0 10px #f39c12, 0 0 20px #f39c12, 0 0 30px #f39c12;
        opacity: 0.9; 
    }
}

.match-time {
    font-size: 1.1em;
    color: #666;
}

.teams-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
}

.team-display {
    flex: 1;
    text-align: center;
}

.team-display img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
}

.team-display h4 {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 5px;
}

.score-display {
    font-size: 3em;
    font-weight: bold;
    color: #667eea;
    min-width: 100px;
    text-align: center;
}

/* Lineups */
.lineups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.lineup {
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.lineup h5 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.formation {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
}

.player-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 5px;
    font-size: 0.95em;
}

.player-number {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.player-name {
    flex: 1;
    color: #333;
}

.player-position {
    color: #666;
    font-size: 0.85em;
}

/* Events (Cards, Goals) */
.match-events {
    margin-top: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.match-events h5 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.event {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 5px;
}

.event-time {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.event-icon {
    font-size: 1.2em;
}

.event-details {
    flex: 1;
    font-size: 0.95em;
}

/* Statistics */
.match-statistics {
    margin-top: 20px;
    background: white;
    padding: 15px;
    border-radius: 8px;
}

.match-statistics h5 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.stat-label {
    flex: 1;
    text-align: center;
    font-weight: bold;
    color: #666;
}

.stat-value {
    min-width: 60px;
    text-align: center;
    font-size: 1.1em;
    color: #333;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: #667eea;
}

/* Footer */
footer {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    color: #666;
}

footer p {
    margin: 5px 0;
}

#last-update {
    font-weight: bold;
    color: #667eea;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: 15px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    margin: 0;
}

.modal-content p {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

.modal-content code {
    background: #667eea;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.modal-content ol {
    text-align: left;
    color: #333;
}

.modal-content ol li {
    margin: 8px 0;
}

.modal-button {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.modal-button:hover {
    background: #764ba2;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .standings-container {
        grid-template-columns: 1fr;
    }

    .teams-display {
        flex-direction: column;
    }

    .score-display {
        font-size: 2em;
    }

    .lineups {
        grid-template-columns: 1fr;
    }

    .team-display img {
        width: 60px;
        height: 60px;
    }
}
