/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-wrapper {
    display: flex;
    flex: 1;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Header */
.main-header {
    background: #2c3e50;
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 1400px;
    margin: 0 auto;
}

.main-header h1 {
    font-size: 20px;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.main-header h1 i {
    margin-right: 8px;
    color: #3498db;
}

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 14px;
    font-weight: 500;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

nav a.active {
    background: #3498db;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: white;
    border-right: 1px solid #e0e0e0;
    height: calc(100vh - 70px);
    overflow-y: auto;
    position: sticky;
    top: 70px;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.leagues-list {
    padding: 10px 0;
}

.league-item {
    border-bottom: 1px solid #f0f0f0;
}

.league-item-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 8px;
}

.league-item-header:hover {
    background: #f8f9fa;
}

.league-item.active .league-item-header {
    background: #e8f4f8;
    border-left: 3px solid #3498db;
}

.league-item-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.league-item-name {
    flex: 1;
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.league-item-count {
    font-size: 11px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
}

.league-toggle {
    font-size: 12px;
    color: #999;
    transition: transform 0.2s;
}

.league-item.active .league-toggle {
    transform: rotate(180deg);
}

.no-leagues {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 15px 20px;
    overflow-y: auto;
    max-width: 900px;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    font-size: 18px;
    color: #2c3e50;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Matches Container */
.matches-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

/* Match Card */
.match-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.match-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.league-name {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.live-badge {
    background: #ff4444;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes highlight {
    0% { background-color: rgba(255, 68, 68, 0.1); }
    100% { background-color: transparent; }
}

.match-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.team-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 8px;
}

.team-name {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.score {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 32px;
    font-weight: bold;
    margin: 0 20px;
    color: #1a1a2e;
}

.score-separator {
    color: #999;
}

.match-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.match-time {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #666;
}

.match-time i {
    font-size: 11px;
}

.btn-details {
    display: inline-block;
    background: #0f3460;
    color: white;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-details:hover {
    background: #1a1a2e;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 18px;
}

.loading i {
    margin-right: 10px;
    font-size: 24px;
}

/* No Matches */
.no-matches {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 18px;
    grid-column: 1 / -1;
}

/* League Section */
.league-section {
    margin-bottom: 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.league-content {
    padding: 0;
}

.league-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.tab-btn {
    flex: 1;
    padding: 8px 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.standings-placeholder {
    padding: 40px;
    text-align: center;
    color: #999;
}

/* Matches List */
.matches-list {
    display: flex;
    flex-direction: column;
}

.match-row {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.match-row,
.match-row:visited,
.match-row:link {
    text-decoration: none;
    color: inherit;
}

.match-row:hover {
    background: #f8f9fa;
}

.match-row:last-child {
    border-bottom: none;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.match-team.home {
    justify-content: flex-start;
}

.match-team.away {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.team-logo-small {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-name-list {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.match-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    padding: 0 10px;
}

.match-time-center {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.match-score-finished {
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

.match-status-live {
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.match-score {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

.match-actions {
    width: 25px;
    display: flex;
    justify-content: center;
    color: #ccc;
}

.match-actions i {
    font-size: 11px;
}

/* Responsive */
@media (max-width: 768px) {
    .matches-container {
        grid-template-columns: 1fr;
    }
    
    .league-section .matches-container {
        grid-template-columns: 1fr;
    }
    
    .score {
        font-size: 24px;
        margin: 0 10px;
    }
    
    /* List format responsive */
    .match-row {
        padding: 10px 12px;
        flex-wrap: wrap;
    }
    
    .match-team {
        flex: 1 1 40%;
        min-width: 120px;
    }
    
    .match-center {
        flex: 1 1 20%;
        min-width: 70px;
        padding: 0 8px;
    }
    
    .match-actions {
        flex: 0 0 30px;
    }
    
    .team-name-list {
        font-size: 13px;
    }
    
    .match-score, .match-time-center {
        font-size: 12px;
    }
    
    nav {
        flex-wrap: wrap;
    }
    
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 300px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .league-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

