/**
 * Rankings Component Styles - Modulare CSS-Datei für Rankings
 * 
 * Diese Datei enthält alle Styles für die Rankings-Komponente
 * und ist vollständig modular und wiederverwendbar.
 * 
 * @author Ben
 * @version 1.0.0
 */

/* ===== RANKINGS COMPONENT ===== */

.rankings-component {
    max-width: 75%;
    margin: 25px auto 20px;
    background: linear-gradient(90deg, #e3f0ff 0%, #90caf9 100%);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: Arial, sans-serif;
    padding: 30px;
}

/* Spezifische Regel für die Profilseite */
.profile-layout .rankings-component {
    max-width: 95%;
    width: 95%;
}

/* Überschreibe die center-section Begrenzung auf der Profilseite */
.center-section .profile-layout .rankings-component {
    max-width: 95% !important;
    width: 95% !important;
}

.rankings-component.simple-mode {
    /* Startseite: Einfache Anzeige mit Chart */
}

.rankings-component.detailed-mode {
    /* Profilseite: Erweiterte Anzeige */
}

.rankings-header {
    margin-bottom: 20px;
    text-align: center;
}

.rankings-header h2 {
    font-size: 1.6em;
    font-weight: 800;
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ===== RANKINGS TABS ===== */

.rankings-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.ranking-tab {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    flex: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.ranking-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.ranking-tab:hover::before {
    left: 100%;
}

.ranking-tab:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ranking-tab.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    font-weight: 800;
}

.ranking-tab i {
    font-size: 1.1em;
}

/* Der "All" Tab verwendet jetzt die gleichen Styles wie die anderen Tabs */

/* ===== RANKING CONTENT ===== */

.ranking-content {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    min-height: 160px;
    backdrop-filter: blur(10px);
}

/* ===== CURRENT RATING DISPLAY ===== */

.current-rating {
    position: absolute;
    top: 20px;
    right: 20px;
    text-align: center;
    z-index: 2;
}

.rating-display {
    margin-bottom: 15px;
}

.rating-value {
    display: block;
    font-size: 2.5em;
    font-weight: 800;
    color: #1976D2;
    line-height: 1;
}

.rating-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    font-weight: 600;
    margin-top: 5px;
}

.rating-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
}

.stat-label {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-top: 2px;
}

/* ===== GRAPH CONTAINER ===== */

.ranking-graph-container {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#rankingChart {
    max-width: 100%;
    max-height: 100%;
}

/* ===== RANKINGS GRID (Profilseite) ===== */

.rankings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 15px;
}

.ranking-card {
    background: white;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ranking-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
}

.ranking-card.bullet::before {
    background: linear-gradient(90deg, #ff6b6b, #ff8e8e);
}

.ranking-card.blitz::before {
    background: linear-gradient(90deg, #ffa726, #ffcc02);
}

.ranking-card.rapid::before {
    background: linear-gradient(90deg, #4ecdc4, #44a08d);
}

.ranking-card.classical::before {
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.ranking-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.ranking-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.ranking-card.bullet .ranking-icon {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
}

.ranking-card.blitz .ranking-icon {
    background: linear-gradient(135deg, #ffa726, #ffcc02);
}

.ranking-card.rapid .ranking-icon {
    background: linear-gradient(135deg, #4ecdc4, #44a08d);
}

.ranking-card.classical .ranking-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.ranking-info {
    flex: 1;
}

.ranking-info h3 {
    margin: 0 0 4px 0;
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

.ranking-rating {
    margin: 0 0 2px 0;
    font-size: 1.4em;
    font-weight: bold;
    color: #2c3e50;
}

.ranking-games {
    margin: 0;
    font-size: 0.85em;
    color: #7f8c8d;
}

/* ===== NO RANKINGS MESSAGE ===== */

.no-rankings {
    text-align: center;
    color: #666;
    padding: 15px;
    font-size: 0.9em;
}

.no-rankings i {
    font-size: 1.5em;
    color: #ccc;
    margin-bottom: 10px;
    display: block;
}

/* ===== ERROR MESSAGE ===== */

.error-message {
    color: #d32f2f;
    padding: 10px;
    text-align: center;
    background: #ffebee;
    border-radius: 4px;
    margin: 10px 0;
}

/* ===== LOADING STATE ===== */

.rankings-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.rankings-loading i {
    font-size: 2em;
    color: #ccc;
    margin-bottom: 10px;
    display: block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .rankings-tabs {
        gap: 8px;
    }
    
    .ranking-tab {
        padding: 10px 16px;
        font-size: 13px;
        min-width: 90px;
    }
    
    .rating-value {
        font-size: 2.2em;
    }
    
    .ranking-graph-container {
        height: 160px;
    }
    
    .rankings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* Mobile (unter 768px) */
@media (max-width: 767px) {
    .rankings-component {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .rankings-header h2 {
        font-size: 1.4em;
    }
    
    .rankings-tabs {
        gap: 6px;
        margin-bottom: 15px;
    }
    
    .ranking-tab {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 80px;
        gap: 6px;
    }
    
    .ranking-tab i {
        font-size: 1em;
    }
    
    .ranking-content {
        padding: 15px;
        min-height: 140px;
    }
    
    .current-rating {
        top: 15px;
        right: 15px;
    }
    
    .rating-value {
        font-size: 2em;
    }
    
    .rating-stats {
        gap: 15px;
    }
    
    .stat-value {
        font-size: 1.1em;
    }
    
    .ranking-graph-container {
        height: 140px;
    }
    
    .rankings-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .ranking-card {
        padding: 10px;
        gap: 6px;
    }
    
    .ranking-icon {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .ranking-info h3 {
        font-size: 0.9em;
    }
    
    .ranking-rating {
        font-size: 1.2em;
    }
    
    .ranking-games {
        font-size: 0.8em;
    }
}

/* Very Small Mobile (unter 480px) */
@media (max-width: 479px) {
    .rankings-component {
        padding: 12px;
    }
    
    .rankings-header h2 {
        font-size: 1.3em;
    }
    
    .rankings-tabs {
        flex-direction: column;
        gap: 4px;
    }
    
    .ranking-tab {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }
    
    .ranking-content {
        padding: 12px;
    }
    
    .current-rating {
        position: relative;
        top: auto;
        right: auto;
        margin-bottom: 15px;
    }
    
    .rating-value {
        font-size: 1.8em;
    }
    
    .rating-stats {
        justify-content: center;
    }
    
    .ranking-graph-container {
        height: 120px;
    }
    
    .ranking-card {
        padding: 8px;
    }
    
    .ranking-icon {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .ranking-info h3 {
        font-size: 0.85em;
    }
    
    .ranking-rating {
        font-size: 1.1em;
    }
    
    .ranking-games {
        font-size: 0.75em;
    }
}

/* ===== DARK MODE SUPPORT (für später) ===== */

@media (prefers-color-scheme: dark) {
    .rankings-component {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .rankings-header h2 {
        color: #e2e8f0;
    }
    
    .ranking-content {
        background: #4a5568;
    }
    
    .ranking-card {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .ranking-info h3 {
        color: #e2e8f0;
    }
    
    .ranking-rating {
        color: #90cdf4;
    }
    
    .ranking-games {
        color: #a0aec0;
    }
    
    .rating-value {
        color: #90cdf4;
    }
    
    .stat-value {
        color: #e2e8f0;
    }
    
    .stat-label {
        color: #a0aec0;
    }
}

/* ===== ACCESSIBILITY ===== */

/* Focus-Stile für bessere Accessibility */
.ranking-tab:focus {
    outline: none;
}

.ranking-card:focus-within {
    outline: none;
}

/* Screen Reader Support */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== ANIMATIONS ===== */

/* Smooth Transitions */
.rankings-component * {
    transition: all 0.3s ease;
}

/* Hover Effects */
.ranking-tab:hover,
.ranking-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.rankings-loading {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== PRINT STYLES ===== */

@media print {
    .rankings-component {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .ranking-tab {
        background: #f5f5f5 !important;
        color: #333 !important;
        border: 1px solid #ccc;
    }
    
    .ranking-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
} 