/**
 * Frontend CSS für Tabelat Plugin
 */

/* Container und Layout */
.tabelat-container,
.tabelat-standings,
.tabelat-matches,
.tabelat-club,
.tabelat-player,
.tabelat-matchday {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Tabellen-Styles */
.tabelat-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.tabelat-standings-table th,
.tabelat-standings-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.tabelat-standings-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tabelat-standings-table tbody tr {
    transition: background-color 0.2s ease;
}

.tabelat-standings-table tbody tr:hover {
    background: #f8f9fa;
}

.tabelat-standings-table .club {
    text-align: left;
    min-width: 200px;
}

.tabelat-standings-table .club-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-right: 8px;
    vertical-align: middle;
}

.tabelat-standings-table .club-name {
    font-weight: 600;
    color: #212529;
}

/* Tabellenposition-Farben */
.tabelat-standings-table .position-1,
.tabelat-standings-table .position-2,
.tabelat-standings-table .position-3,
.tabelat-standings-table .position-4 {
    border-left: 4px solid #0073aa;
}

.tabelat-standings-table .position-5,
.tabelat-standings-table .position-6 {
    border-left: 4px solid #ff6900;
}

.tabelat-standings-table .position-7 {
    border-left: 4px solid #5f5f5f;
}

.tabelat-standings-table tr:nth-last-child(-n+3) {
    border-left: 4px solid #dc3232;
}

/* Tordifferenz-Farben */
.tabelat-standings-table .diff.positive {
    color: #28a745;
    font-weight: 600;
}

.tabelat-standings-table .diff.negative {
    color: #dc3545;
    font-weight: 600;
}

/* Begegnungen-Liste */
.tabelat-matches-list {
    display: grid;
    gap: 15px;
    margin: 20px 0;
}

.match-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.match-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.match-item.status-live {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff 0%, #ffebee 100%);
}

.match-item.status-finished {
    border-color: #28a745;
}

.match-date {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.match-time {
    font-weight: 600;
    margin-left: 5px;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.home-team,
.away-team {
    display: flex;
    align-items: center;
    flex: 1;
    font-weight: 600;
    color: #212529;
}

.away-team {
    justify-content: flex-end;
    text-align: right;
}

.match-teams .club-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin: 0 8px;
}

.match-score {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    font-size: 18px;
    font-weight: bold;
    color: #212529;
}

.match-score .vs {
    color: #6c757d;
    font-size: 14px;
}

.match-day {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    margin-top: 5px;
}

/* Vereinsprofil */
.tabelat-club .club-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tabelat-club .club-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-right: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tabelat-club .club-name {
    font-size: 28px;
    font-weight: bold;
    color: #212529;
    margin: 0;
}

.tabelat-club .club-bio,
.tabelat-player .player-bio {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    line-height: 1.6;
    color: #495057;
}

.tabelat-club .club-info,
.tabelat-player .player-info {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.club-info .info-item,
.player-info .info-item {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.club-info .info-item:last-child,
.player-info .info-item:last-child {
    border-bottom: none;
}

.club-info .info-item strong,
.player-info .info-item strong {
    min-width: 120px;
    color: #6c757d;
    font-weight: 600;
}

/* Spielerprofil */
.tabelat-player .player-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tabelat-player .player-photo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 20px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tabelat-player .player-title .player-name {
    font-size: 28px;
    font-weight: bold;
    color: #212529;
    margin: 0 0 5px 0;
}

.tabelat-player .player-title .player-club {
    font-size: 16px;
    color: #6c757d;
    margin: 0;
}

/* Vereinsspieler-Liste */
.club-players {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.club-players h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    color: #212529;
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.player-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.player-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.player-item .player-photo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.player-info .player-name {
    font-weight: 600;
    color: #212529;
    display: block;
    margin-bottom: 2px;
}

.player-info .jersey-number {
    background: #0073aa;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 5px;
}

.player-info .position {
    font-size: 12px;
    color: #6c757d;
}

/* Widget-Styles */
.tabelat-widget-standings .standing-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.tabelat-widget-standings .standing-row:last-child {
    border-bottom: none;
}

.tabelat-widget-standings .position {
    min-width: 30px;
    font-weight: bold;
    color: #495057;
}

.tabelat-widget-standings .club-logo-small {
    width: 20px;
    height: 20px;
    object-fit: contain;
    margin-right: 8px;
}

.tabelat-widget-standings .club-name {
    flex: 1;
    font-weight: 600;
    color: #212529;
}

.tabelat-widget-standings .points {
    min-width: 30px;
    text-align: right;
    font-weight: bold;
    color: #0073aa;
}

/* Widget Begegnungen */
.tabelat-widget-matches .match-row {
    margin-bottom: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.tabelat-widget-matches .match-row:last-child {
    margin-bottom: 0;
}

.tabelat-widget-matches .match-teams {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.tabelat-widget-matches .home-team,
.tabelat-widget-matches .away-team {
    display: flex;
    align-items: center;
    flex: 1;
    font-size: 13px;
    font-weight: 600;
}

.tabelat-widget-matches .away-team {
    justify-content: flex-end;
    text-align: right;
}

.tabelat-widget-matches .club-logo-small {
    width: 16px;
    height: 16px;
    object-fit: contain;
    margin: 0 4px;
}

.tabelat-widget-matches .match-result {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

.tabelat-widget-matches .match-time {
    font-size: 11px;
    color: #6c757d;
}

.tabelat-widget-matches .match-date {
    font-size: 11px;
    color: #6c757d;
    text-align: center;
}

/* Widget Verein */
.tabelat-widget-club .club-logo-container {
    text-align: center;
    margin-bottom: 15px;
}

.tabelat-widget-club .club-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tabelat-widget-club .club-name {
    text-align: center;
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: bold;
    color: #212529;
}

.tabelat-widget-club .info-row {
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 13px;
}

.tabelat-widget-club .info-row:last-child {
    border-bottom: none;
}

.tabelat-widget-club .info-row strong {
    color: #6c757d;
}

.tabelat-widget-club .club-bio {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.4;
    color: #495057;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tabelat-standings-table {
        font-size: 14px;
    }
    
    .tabelat-standings-table th,
    .tabelat-standings-table td {
        padding: 8px 4px;
    }
    
    .tabelat-standings-table .club-name {
        font-size: 13px;
    }
    
    .match-teams {
        flex-direction: column;
        text-align: center;
    }
    
    .home-team,
    .away-team {
        margin-bottom: 5px;
    }
    
    .away-team {
        justify-content: center;
        text-align: center;
    }
    
    .match-teams .club-logo {
        width: 24px;
        height: 24px;
    }
    
    .tabelat-club .club-header,
    .tabelat-player .player-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tabelat-club .club-logo,
    .tabelat-player .player-photo {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .players-list {
        grid-template-columns: 1fr;
    }
    
    .club-info .info-item,
    .player-info .info-item {
        flex-direction: column;
    }
    
    .club-info .info-item strong,
    .player-info .info-item strong {
        min-width: auto;
        margin-bottom: 2px;
    }
}

@media (max-width: 480px) {
    .tabelat-table {
        font-size: 12px;
    }
    
    .tabelat-standings-table .club {
        min-width: 120px;
    }
    
    .tabelat-standings-table .club-logo {
        width: 20px;
        height: 20px;
    }
    
    .match-item {
        padding: 15px;
    }
    
    .tabelat-club .club-name,
    .tabelat-player .player-name {
        font-size: 24px;
    }
}

/* Print Styles */
@media print {
    .tabelat-container,
    .tabelat-standings,
    .tabelat-matches,
    .tabelat-club,
    .tabelat-player {
        box-shadow: none;
        background: #fff;
    }
    
    .match-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .tabelat-table {
        box-shadow: none;
    }
}
