/* 
 * WP Football Manager - Frontend Styles
 * Responsive Design für alle Geräte
 */

/* CSS-Variablen für konsistente Farbschemas */
:root {
    --wfm-primary: #1e40af;
    --wfm-secondary: #0d9488;
    --wfm-accent: #f97316;
    --wfm-success: #16a34a;
    --wfm-warning: #eab308;
    --wfm-error: #dc2626;
    --wfm-champions-league: #1e40af;
    --wfm-europa-league: #f97316;
    --wfm-relegation: #dc2626;
    --wfm-neutral-50: #f8fafc;
    --wfm-neutral-100: #f1f5f9;
    --wfm-neutral-200: #e2e8f0;
    --wfm-neutral-300: #cbd5e1;
    --wfm-neutral-400: #94a3b8;
    --wfm-neutral-500: #64748b;
    --wfm-neutral-600: #475569;
    --wfm-neutral-700: #334155;
    --wfm-neutral-800: #1e293b;
    --wfm-neutral-900: #0f172a;
    --wfm-border-radius: 8px;
    --wfm-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --wfm-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --wfm-transition: all 0.2s ease-in-out;
}

/* Reset und Base Styles */
.wfm-league-table *,
.wfm-next-matches *,
.wfm-player-stats *,
.wfm-team-info *,
.wfm-latest-results *,
.wfm-match-countdown *,
.wfm-top-scorers * {
    box-sizing: border-box;
}

/* Liga-Tabelle */
.wfm-league-table {
    background: #fff;
    border-radius: var(--wfm-border-radius);
    box-shadow: var(--wfm-shadow);
    overflow: hidden;
    margin: 1.5rem 0;
}

.wfm-table-header {
    background: linear-gradient(135deg, var(--wfm-primary), var(--wfm-secondary));
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.wfm-table-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.wfm-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wfm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.wfm-table thead th {
    background: var(--wfm-neutral-100);
    color: var(--wfm-neutral-700);
    font-weight: 600;
    padding: 0.75rem 0.5rem;
    text-align: left;
    border-bottom: 2px solid var(--wfm-neutral-200);
    white-space: nowrap;
}

.wfm-table tbody tr {
    border-bottom: 1px solid var(--wfm-neutral-200);
    transition: var(--wfm-transition);
}

.wfm-table tbody tr:hover {
    background: var(--wfm-neutral-50);
}

.wfm-table tbody td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

/* Positionsbasierte Färbung */
.wfm-table tbody tr.wfm-champions-league {
    border-left: 4px solid var(--wfm-champions-league);
}

.wfm-table tbody tr.wfm-europa-league {
    border-left: 4px solid var(--wfm-europa-league);
}

.wfm-table tbody tr.wfm-relegation {
    border-left: 4px solid var(--wfm-relegation);
}

/* Spezielle Spalten-Styles */
.wfm-position {
    font-weight: 600;
    text-align: center;
    width: 40px;
}

.wfm-team {
    font-weight: 500;
    min-width: 150px;
}

.wfm-team a {
    color: var(--wfm-neutral-800);
    text-decoration: none;
    transition: var(--wfm-transition);
}

.wfm-team a:hover {
    color: var(--wfm-primary);
}

.wfm-matches,
.wfm-wins,
.wfm-draws,
.wfm-losses,
.wfm-goals,
.wfm-points {
    text-align: center;
    width: 50px;
}

.wfm-diff {
    text-align: center;
    width: 60px;
    font-weight: 500;
}

.wfm-diff.positive {
    color: var(--wfm-success);
}

.wfm-diff.negative {
    color: var(--wfm-error);
}

.wfm-points {
    font-weight: 700;
    color: var(--wfm-primary);
}

/* Form-Anzeige */
.wfm-form {
    text-align: center;
    white-space: nowrap;
}

.wfm-form-win,
.wfm-form-draw,
.wfm-form-loss {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    border-radius: 50%;
    margin: 0 1px;
}

.wfm-form-win {
    background: var(--wfm-success);
}

.wfm-form-draw {
    background: var(--wfm-warning);
}

.wfm-form-loss {
    background: var(--wfm-error);
}

/* Tabellen-Legende */
.wfm-table-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--wfm-neutral-50);
    font-size: 0.875rem;
}

.wfm-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wfm-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.wfm-legend-item.wfm-champions-league .wfm-legend-color {
    background: var(--wfm-champions-league);
}

.wfm-legend-item.wfm-europa-league .wfm-legend-color {
    background: var(--wfm-europa-league);
}

.wfm-legend-item.wfm-relegation .wfm-legend-color {
    background: var(--wfm-relegation);
}

/* Nächste Spiele */
.wfm-next-matches {
    background: #fff;
    border-radius: var(--wfm-border-radius);
    box-shadow: var(--wfm-shadow);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.wfm-next-matches h3 {
    margin: 0 0 1.5rem 0;
    color: var(--wfm-neutral-800);
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 2px solid var(--wfm-primary);
    padding-bottom: 0.5rem;
}

.wfm-matches-list {
    display: grid;
    gap: 1rem;
}

.wfm-match-item {
    border: 1px solid var(--wfm-neutral-200);
    border-radius: var(--wfm-border-radius);
    padding: 1rem;
    transition: var(--wfm-transition);
}

.wfm-match-item:hover {
    border-color: var(--wfm-primary);
    box-shadow: var(--wfm-shadow);
}

.wfm-match-date {
    color: var(--wfm-neutral-600);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.wfm-match-time {
    font-weight: 600;
    margin-left: 0.5rem;
}

.wfm-match-teams {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--wfm-neutral-800);
}

.wfm-vs {
    margin: 0 0.5rem;
    color: var(--wfm-neutral-400);
    font-weight: 400;
}

.wfm-match-league {
    font-size: 0.75rem;
    color: var(--wfm-neutral-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.wfm-match-link {
    display: inline-block;
    background: var(--wfm-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--wfm-transition);
}

.wfm-match-link:hover {
    background: var(--wfm-secondary);
    transform: translateY(-1px);
}

/* Spieler-Statistiken */
.wfm-player-stats {
    background: #fff;
    border-radius: var(--wfm-border-radius);
    box-shadow: var(--wfm-shadow);
    overflow: hidden;
    margin: 1.5rem 0;
}

.wfm-player-profile {
    background: linear-gradient(135deg, var(--wfm-neutral-100), var(--wfm-neutral-200));
    padding: 1.5rem;
}

.wfm-player-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wfm-player-photo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--wfm-primary);
}

.wfm-player-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--wfm-neutral-800);
}

.wfm-player-position,
.wfm-player-team,
.wfm-player-age {
    color: var(--wfm-neutral-600);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.wfm-player-team a {
    color: var(--wfm-primary);
    text-decoration: none;
    font-weight: 500;
}

.wfm-player-team a:hover {
    text-decoration: underline;
}

.wfm-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0;
}

.wfm-stat-item {
    text-align: center;
    padding: 1.5rem 1rem;
    border-right: 1px solid var(--wfm-neutral-200);
    transition: var(--wfm-transition);
}

.wfm-stat-item:last-child {
    border-right: none;
}

.wfm-stat-item:hover {
    background: var(--wfm-neutral-50);
}

.wfm-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--wfm-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.wfm-stat-label {
    font-size: 0.875rem;
    color: var(--wfm-neutral-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Team-Info */
.wfm-team-info {
    background: #fff;
    border-radius: var(--wfm-border-radius);
    box-shadow: var(--wfm-shadow);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.wfm-team-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.wfm-team-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.wfm-team-details {
    flex: 1;
}

.wfm-team-name {
    margin: 0 0 1rem 0;
    color: var(--wfm-neutral-800);
    font-size: 1.5rem;
    font-weight: 600;
}

.wfm-team-founded,
.wfm-team-coach,
.wfm-team-stadium {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.wfm-team-founded strong,
.wfm-team-coach strong,
.wfm-team-stadium strong {
    color: var(--wfm-neutral-700);
}

.wfm-stadium-capacity {
    color: var(--wfm-neutral-500);
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.wfm-team-leagues {
    margin: 1rem 0;
}

.wfm-league-badge {
    display: inline-block;
    background: var(--wfm-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.wfm-team-social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.wfm-social-link {
    background: var(--wfm-neutral-200);
    color: var(--wfm-neutral-700);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--wfm-transition);
}

.wfm-social-link:hover {
    background: var(--wfm-primary);
    color: white;
    transform: translateY(-1px);
}

.wfm-team-link {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--wfm-neutral-200);
}

.wfm-btn {
    display: inline-block;
    background: var(--wfm-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--wfm-border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--wfm-transition);
}

.wfm-btn:hover {
    background: var(--wfm-secondary);
    transform: translateY(-1px);
    box-shadow: var(--wfm-shadow-lg);
}

/* Horizontales Layout für Team-Info */
.wfm-team-info.wfm-layout-horizontal .wfm-team-header {
    flex-direction: row;
}

/* Vertikales Layout für Team-Info */
.wfm-team-info.wfm-layout-vertical .wfm-team-header {
    flex-direction: column;
    text-align: center;
}

/* Letzte Ergebnisse */
.wfm-latest-results {
    background: #fff;
    border-radius: var(--wfm-border-radius);
    box-shadow: var(--wfm-shadow);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.wfm-latest-results h3 {
    margin: 0 0 1.5rem 0;
    color: var(--wfm-neutral-800);
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 2px solid var(--wfm-success);
    padding-bottom: 0.5rem;
}

.wfm-results-list {
    display: grid;
    gap: 1rem;
}

.wfm-result-item {
    border: 1px solid var(--wfm-neutral-200);
    border-radius: var(--wfm-border-radius);
    padding: 1rem;
    transition: var(--wfm-transition);
}

.wfm-result-item:hover {
    border-color: var(--wfm-success);
    box-shadow: var(--wfm-shadow);
}

.wfm-match-result {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--wfm-neutral-800);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.wfm-score {
    background: var(--wfm-success);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

/* Match Countdown */
.wfm-match-countdown {
    background: #fff;
    border-radius: var(--wfm-border-radius);
    box-shadow: var(--wfm-shadow);
    padding: 2rem;
    margin: 1.5rem 0;
    text-align: center;
}

.wfm-countdown-header {
    margin-bottom: 2rem;
}

.wfm-match-teams {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--wfm-neutral-800);
    margin-bottom: 0.5rem;
}

.wfm-match-datetime {
    color: var(--wfm-neutral-600);
    font-size: 1rem;
}

.wfm-countdown-timer {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.wfm-countdown-item {
    text-align: center;
}

.wfm-countdown-number {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--wfm-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.wfm-countdown-label {
    font-size: 0.875rem;
    color: var(--wfm-neutral-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wfm-countdown-ended {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--wfm-success);
    padding: 2rem;
    background: var(--wfm-neutral-100);
    border-radius: var(--wfm-border-radius);
}

/* Top Torschützen */
.wfm-top-scorers {
    background: #fff;
    border-radius: var(--wfm-border-radius);
    box-shadow: var(--wfm-shadow);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.wfm-top-scorers h3 {
    margin: 0 0 1.5rem 0;
    color: var(--wfm-neutral-800);
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 2px solid var(--wfm-accent);
    padding-bottom: 0.5rem;
}

.wfm-scorers-list {
    display: grid;
    gap: 0.75rem;
}

.wfm-scorer-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--wfm-neutral-200);
    border-radius: var(--wfm-border-radius);
    transition: var(--wfm-transition);
}

.wfm-scorer-item:hover {
    border-color: var(--wfm-accent);
    box-shadow: var(--wfm-shadow);
}

.wfm-scorer-rank {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--wfm-primary);
    min-width: 30px;
    text-align: center;
}

.wfm-scorer-photo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.wfm-scorer-info {
    flex: 1;
}

.wfm-scorer-name a {
    color: var(--wfm-neutral-800);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
}

.wfm-scorer-name a:hover {
    color: var(--wfm-primary);
}

.wfm-scorer-team {
    font-size: 0.875rem;
    color: var(--wfm-neutral-500);
    margin-top: 0.25rem;
}

.wfm-scorer-team a {
    color: var(--wfm-secondary);
    text-decoration: none;
}

.wfm-scorer-team a:hover {
    text-decoration: underline;
}

.wfm-scorer-goals {
    text-align: center;
    min-width: 60px;
}

.wfm-goals-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--wfm-accent);
    line-height: 1;
}

.wfm-goals-label {
    font-size: 0.75rem;
    color: var(--wfm-neutral-500);
    text-transform: uppercase;
}

/* Responsive Design */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .wfm-table-responsive {
        font-size: 0.8rem;
    }
    
    .wfm-countdown-timer {
        gap: 1rem;
    }
    
    .wfm-countdown-number {
        font-size: 2.5rem;
    }
    
    .wfm-team-header {
        gap: 1rem;
    }
    
    .wfm-team-logo img {
        width: 60px;
        height: 60px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .wfm-table {
        font-size: 0.75rem;
    }
    
    .wfm-table thead th,
    .wfm-table tbody td {
        padding: 0.5rem 0.25rem;
    }
    
    .wfm-table-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .wfm-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .wfm-stat-item {
        padding: 1rem 0.5rem;
    }
    
    .wfm-stat-value {
        font-size: 1.5rem;
    }
    
    .wfm-countdown-timer {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .wfm-countdown-item {
        flex: 1;
        min-width: 80px;
    }
    
    .wfm-countdown-number {
        font-size: 2rem;
    }
    
    .wfm-team-header {
        flex-direction: column;
        text-align: center;
    }
    
    .wfm-team-social {
        flex-direction: column;
        align-items: center;
    }
    
    .wfm-scorer-item {
        gap: 0.75rem;
    }
    
    .wfm-scorer-photo img {
        width: 35px;
        height: 35px;
    }
    
    .wfm-match-result {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Sehr kleine Mobile-Geräte (< 480px) */
@media (max-width: 480px) {
    .wfm-league-table,
    .wfm-next-matches,
    .wfm-player-stats,
    .wfm-team-info,
    .wfm-latest-results,
    .wfm-match-countdown,
    .wfm-top-scorers {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    .wfm-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wfm-countdown-timer {
        grid-template-columns: repeat(2, 1fr);
        display: grid;
    }
    
    .wfm-player-header {
        flex-direction: column;
        text-align: center;
    }
    
    .wfm-player-photo img {
        width: 60px;
        height: 60px;
    }
    
    /* Tabelle horizontal scrollbar auf sehr kleinen Geräten */
    .wfm-table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .wfm-table {
        min-width: 600px;
    }
}

/* Print Styles */
@media print {
    .wfm-league-table,
    .wfm-next-matches,
    .wfm-player-stats,
    .wfm-team-info,
    .wfm-latest-results,
    .wfm-top-scorers {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
    
    .wfm-match-countdown {
        display: none;
    }
    
    .wfm-match-link,
    .wfm-btn,
    .wfm-social-link {
        display: none;
    }
}

/* Dark Mode Support (falls vom Theme unterstützt) */
@media (prefers-color-scheme: dark) {
    :root {
        --wfm-neutral-50: #1e293b;
        --wfm-neutral-100: #334155;
        --wfm-neutral-200: #475569;
        --wfm-neutral-900: #f8fafc;
        --wfm-neutral-800: #f1f5f9;
        --wfm-neutral-700: #e2e8f0;
    }
}

/* Accessibility Verbesserungen */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus States für Accessibility */
.wfm-team a:focus,
.wfm-match-link:focus,
.wfm-btn:focus,
.wfm-social-link:focus,
.wfm-scorer-name a:focus,
.wfm-scorer-team a:focus,
.wfm-player-team a:focus {
    outline: 2px solid var(--wfm-primary);
    outline-offset: 2px;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .wfm-form-win,
    .wfm-form-draw,
    .wfm-form-loss {
        border: 1px solid currentColor;
    }
    
    .wfm-legend-color {
        border: 1px solid currentColor;
    }
}