/* Файл: dotascore/static/css/player_detail.css */
/* Стили для страницы профиля игрока с графиком */

/* ========================================================= */
/* --- ОСНОВНОЙ КОНТЕЙНЕР --- */
/* ========================================================= */

.player-profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #f0f8ff;
}

/* ========================================================= */
/* --- КНОПКА ВОЗВРАТА --- */
/* ========================================================= */

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #00FFFF;
    text-decoration: none;
    font-size: 1.1em;
    padding: 10px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.back-button:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00FFFF;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.back-arrow {
    font-size: 1.3em;
    line-height: 1;
}

/* ========================================================= */
/* --- КАРТОЧКА ИГРОКА --- */
/* ========================================================= */

.player-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.player-header {
    display: flex;
    align-items: center;
    gap: 30px;
}

.player-avatar-container {
    flex-shrink: 0;
}

.player-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #00FFFF;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

.player-avatar-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
    color: white;
    border: 3px solid #00FFFF;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

.player-info {
    flex-grow: 1;
}

.player-nickname {
    font-size: 2.5em;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.player-details {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.player-rank-name,
.player-dota-rank,
.player-total-score {
    font-size: 1.1em;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================================= */
/* --- ПАНЕЛЬ ВЫБОРА ДАТ --- */
/* ========================================================= */

.date-range-panel {
    background: rgba(26, 26, 46, 0.8);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #333;
}

.chart-title {
    margin: 0 0 20px 0;
    font-size: 1.5em;
    color: #00FFFF;
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-input-group label {
    color: #b3b3b3;
    font-weight: bold;
}

.date-input-group input[type="date"] {
    padding: 10px 15px;
    background: #222;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 1em;
    cursor: pointer;
    transition: border-color 0.3s;
}

.date-input-group input[type="date"]:focus {
    outline: none;
    border-color: #00FFFF;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.date-input-group input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.apply-button,
.reset-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-button {
    background: #00FFFF;
    color: #1a1a2e;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.apply-button:hover {
    background: #33FFFF;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    transform: translateY(-2px);
}

.reset-button {
    background: transparent;
    color: #b3b3b3;
    border: 1px solid #555;
}

.reset-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #b3b3b3;
}

/* Пресеты дат */
.date-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.preset-button {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #555;
    border-radius: 20px;
    color: #b3b3b3;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-button:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00FFFF;
    color: #00FFFF;
}

.preset-button.active {
    background: rgba(0, 255, 255, 0.15);
    border-color: #00FFFF;
    color: #00FFFF;
}

/* ========================================================= */
/* --- КОНТЕЙНЕР ГРАФИКА --- */
/* ========================================================= */

.chart-container {
    position: relative;
    background: rgba(26, 26, 46, 0.8);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #333;
    min-height: 400px;
}

#score-chart {
    width: 100% !important;
    height: auto !important;
    max-height: 400px;
}

.chart-loading,
.chart-error,
.chart-no-data {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #b3b3b3;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 255, 255, 0.3);
    border-top-color: #00FFFF;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.chart-error p {
    color: #ff6b6b;
    margin-bottom: 15px;
}

.retry-button {
    padding: 10px 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.retry-button:hover {
    background: #ff8585;
}

.chart-no-data p {
    color: #ffd93d;
    font-size: 1.2em;
}

/* ========================================================= */
/* --- ПАНЕЛЬ СТАТИСТИКИ --- */
/* ========================================================= */

.stats-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid #333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-color: #00FFFF;
}

.stat-label {
    display: block;
    color: #b3b3b3;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    color: #00FFFF;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* ========================================================= */
/* --- АДАПТИВНОСТЬ ДЛЯ МОБИЛЬНЫХ (≤ 768px) --- */
/* ========================================================= */

@media (max-width: 768px) {
    
    .player-profile-container {
        padding: 15px;
    }
    
    .back-button {
        padding: 8px 16px;
        font-size: 1em;
    }
    
    .player-card {
        padding: 20px;
    }
    
    .player-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .player-avatar-large,
    .player-avatar-placeholder {
        width: 100px;
        height: 100px;
    }
    
    .player-nickname {
        font-size: 2em;
    }
    
    .player-details {
        justify-content: center;
    }
    
    .player-rank-name,
    .player-dota-rank,
    .player-total-score {
        font-size: 0.9em;
        padding: 6px 12px;
    }
    
    .date-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-input-group {
        justify-content: space-between;
    }
    
    .apply-button,
    .reset-button {
        width: 100%;
    }
    
    .stats-panel {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .chart-container {
        padding: 15px;
        min-height: 300px;
    }
    
    #score-chart {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    
    .player-nickname {
        font-size: 1.5em;
    }
    
    .player-details {
        flex-direction: column;
        gap: 10px;
    }
    
    .stats-panel {
        grid-template-columns: 1fr;
    }
    
    .date-presets {
        justify-content: center;
    }
}