/**
 * css/tournament-match-history.css - CSS für Spielverlauf/Match History
 * Pfad: /css/tournament-match-history.css
 * 
 * Funktionen:
 * - Vollständige Styles für Match History Timeline
 * - Team Badges mit Farbkodierung
 * - Responsive Timeline-Layout
 * - Status-Anzeigen und Scores
 * - Tablet-optimierte Darstellung
 * 
 * ERGÄNZUNG zur bestehenden tournament.css - diese Styles hinzufügen!
 */

/* ==========================================
   MATCH HISTORY TIMELINE STYLES
   ========================================== */

.match-history-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin-bottom: 2rem;
}

.match-timeline {
    padding: 1rem;
}

.time-slot {
    margin-bottom: 2rem;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 1.5rem;
}

.time-slot:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.time-header {
    background: linear-gradient(135deg, var(--tennis-blue), var(--tennis-blue-dark));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    position: relative;
}

.time-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), #ffed4e, var(--gold));
}

.time-header h4 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.time-header i {
    margin-right: 0.5rem;
    color: var(--gold);
}

.matches-in-slot {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* ==========================================
   MATCH HISTORY CARDS
   ========================================== */

.match-history-card {
    background: linear-gradient(135deg, #ffffff, #f8f9ff);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.match-history-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--tennis-blue), var(--tennis-blue-light));
    transition: background 0.3s ease;
}

.match-history-card:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

.match-history-card:hover::before {
    background: linear-gradient(90deg, var(--gold), #ffed4e);
}

.match-history-card.finished {
    background: linear-gradient(135deg, #d4edda, #e8f5e9);
    border-color: #28a745;
}

.match-history-card.finished::before {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.match-history-card.pending {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border-color: #ffc107;
}

.match-history-card.pending::before {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

/* ==========================================
   MATCH CARD COMPONENTS
   ========================================== */

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.match-number {
    font-weight: bold;
    color: var(--tennis-blue-dark);
    font-size: 1.1rem;
}

.court-info {
    background: var(--tennis-blue);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1rem 0;
    gap: 1rem;
}

.team-side {
    flex: 1;
    text-align: center;
    transition: all 0.3s ease;
}

.team-side.winner {
    transform: scale(1.05);
}

.team-side.draw {
    opacity: 0.8;
}

.vs-section {
    flex: 0 0 auto;
    text-align: center;
    padding: 0 1rem;
}

.vs-text {
    font-weight: bold;
    color: var(--tennis-blue);
    font-size: 1.2rem;
    padding: 0.5rem;
}

.score-display {
    background: linear-gradient(135deg, var(--tennis-blue), var(--tennis-blue-dark));
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(59, 130, 196, 0.3);
}

.score-large {
    font-size: 1.5rem;
    font-weight: bold;
}

.team-players {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

.match-status {
    text-align: center;
    margin-top: 1rem;
}

.match-status .badge {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* ==========================================
   TEAM BADGES SYSTEM
   ========================================== */

.team-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    min-width: 80px;
    transition: all 0.3s ease;
    border: 2px solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.team-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Team-spezifische Farben */
.team-side .team-badge {
    margin-bottom: 0.5rem;
}

.players-badge {
    display: block;
    color: #6c757d;
    font-style: italic;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablet Landscape */
@media (max-width: 1024px) {
    .matches-in-slot {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 0.75rem;
    }
    
    .match-history-card {
        padding: 1.25rem;
    }
    
    .time-header h4 {
        font-size: 1.2rem;
    }
    
    .match-teams {
        gap: 0.75rem;
    }
    
    .score-display {
        font-size: 1.1rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Tablet Portrait */
@media (max-width: 768px) {
    .matches-in-slot {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .match-history-card {
        padding: 1rem;
    }
    
    .match-teams {
        flex-direction: column;
        gap: 1rem;
    }
    
    .vs-section {
        order: 2;
        padding: 0.5rem 0;
    }
    
    .team-side {
        flex: none;
        width: 100%;
    }
    
    .time-header {
        padding: 0.75rem 1rem;
        text-align: center;
    }
    
    .time-header h4 {
        font-size: 1.1rem;
    }
    
    .match-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .court-info {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .match-history-container {
        margin: 0 -15px;
        border-radius: 0;
    }
    
    .match-timeline {
        padding: 0.75rem;
    }
    
    .time-slot {
        margin-bottom: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .match-history-card {
        padding: 0.75rem;
        border-radius: 8px;
    }
    
    .time-header {
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
    }
    
    .time-header h4 {
        font-size: 1rem;
    }
    
    .team-badge {
        min-width: 70px;
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .score-display {
        font-size: 1rem;
        padding: 0.5rem 0.7rem;
    }
    
    .match-status .badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .match-history-container {
        box-shadow: none;
        border: 1px solid #333;
        page-break-inside: avoid;
    }
    
    .time-header {
        background: #f8f9fa !important;
        color: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .match-history-card {
        border: 1px solid #333;
        box-shadow: none;
        background: white !important;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .match-history-card::before {
        display: none;
    }
    
    .team-badge {
        border: 1px solid #333 !important;
        background: white !important;
        color: #333 !important;
        box-shadow: none;
    }
    
    .score-display {
        background: #f8f9fa !important;
        color: #333 !important;
        border: 1px solid #333;
    }
}

/* ==========================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .match-history-card,
    .team-badge,
    .team-side {
        transition: none;
    }
    
    .match-history-card:hover {
        transform: none;
    }
    
    .team-side.winner {
        transform: none;
    }
}

@media (prefers-contrast: high) {
    .match-history-card {
        border-width: 3px;
    }
    
    .team-badge {
        border-width: 3px;
        font-weight: bold;
    }
    
    .time-header {
        border: 3px solid #000;
    }
}

/* ==========================================
   FOCUS STATES für Accessibility
   ========================================== */

.match-history-card:focus-within {
    outline: 3px solid var(--gold);
    outline-offset: 2px;
}

.team-badge:focus {
    outline: 2px solid var(--tennis-blue);
    outline-offset: 2px;
}