/* FACEIT Profile Viewer - Player Profile Page */

/* ===== PLAYER PROFILE PAGE LAYOUT ===== */
.player-profile-page {
    /* Page identifier class for scoped styling */
}

/* ===== HERO SECTION ===== */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #4169E1 0%, #5A7BED 100%);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin: 0 auto 40px auto;
    max-width: 1200px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="g"><stop offset="20%" stop-color="rgba(255,255,255,0.1)"/><stop offset="80%" stop-color="rgba(255,255,255,0)"/></radialGradient></defs><circle cx="200" cy="200" r="180" fill="url(%23g)"/><circle cx="800" cy="300" r="120" fill="url(%23g)"/><circle cx="400" cy="700" r="200" fill="url(%23g)"/></svg>');
    opacity: 0.3;
}

/* Hero content - 50/50 split layout, 25% smaller */
.player-profile-page .hero-content,
body.player-profile-page .hero-content {
    position: relative !important;
    z-index: 2 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    align-items: center !important;
    padding: 12px 16px !important;
    min-height: auto !important;
    height: 300px !important;
}

.player-main-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    flex: 1;
    height: 100%;
    justify-content: center;
    padding-right: 8px;
}

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

.player-avatar-round {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* Player Top Row: Avatar + Name (Horizontal) */
.player-top-row {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
}

.player-name-container {
    flex: 1;
    min-width: 0;
    padding-top: 4px;
}

/* Player Metadata: ELO + Flag + Status (Vertical Stack) */
.player-metadata {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 600;
}

.flag-elo-combined .elo-display {
    background: rgba(255, 255, 255, 0.15);
    padding: 10px 20px;
    border-radius: 24px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    margin-right: 12px;
}

.flag-elo-combined .elo-value {
    color: white;
    font-weight: 800;
    font-size: 22px;
}

.flag-elo-combined .elo-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 17px;
    margin-left: 6px;
}

.flag-elo-combined .country-flag {
    font-size: 28px;
}

.status-info .player-status {
    font-size: 16px;
    font-weight: 700;
    gap: 10px;
}

.status-info .status-indicator {
    width: 14px;
    height: 14px;
}

/* REDESIGNED: Player name with proper spacing */
.player-profile-page .player-name-container h1.player-name,
.player-profile-page .hero-section .player-name,
body.player-profile-page h1.player-name,
h1.player-name {
    font-size: 2.2rem !important;
    font-weight: 900 !important;
    margin: 0 !important;
    color: white !important;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5) !important;
    line-height: 1.3 !important;
    letter-spacing: -0.02em !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    padding: 4px 0 !important;
}

/* Removed - replaced with metadata system */

.player-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.player-status .status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success-color);
}

.player-status.active .status-indicator {
    background: var(--success-color);
    animation: pulse 2s infinite;
}

.player-status.idle .status-indicator {
    background: var(--warning-color);
}

.player-status.gone .status-indicator {
    background: var(--error-color);
}

.player-status.inactive .status-indicator {
    background: var(--error-color);
}

/* ===== SPIDER CHART CONTAINER - PROPER SIZE ===== */
.hero-content .spider-chart-container,
.player-profile-page .hero-content .spider-chart-container {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.05) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    width: 100% !important;
    height: 276px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    flex: 1 !important;
    position: relative !important;
}

#playerRadarChart {
    max-width: 100% !important;
    max-height: 100% !important;
    width: 390px !important;
    height: 252px !important;
}

/* ===== QUICK STATS BAR ===== */
.quick-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1px;
    background: var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 32px;
}

.quick-stat {
    background: var(--bg-secondary);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.quick-stat:hover {
    background: var(--hover-bg);
}

.quick-stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.quick-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== MATCH CONTROLS ===== */
.match-controls {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}

.match-controls h3 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.slider-container span {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.match-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    outline: none;
    -webkit-appearance: none;
}

.match-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.match-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-value {
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    min-width: 40px;
    text-align: center;
}

/* ===== TOLTOV SECTION ===== */
.toltov-section {
    margin-bottom: 32px;
}

.toltov-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 32px;
    align-items: start;
}

.toltov-score h3 {
    margin: 0 0 16px 0;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toltov-value {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1;
}

.toltov-tier {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.toltov-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

.rating-table {
    font-size: 12px;
    line-height: 1.5;
}

.rating-row {
    display: grid;
    grid-template-columns: 80px 100px 80px 1fr;
    gap: 12px;
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}

.rating-row:first-child {
    font-weight: 600;
    color: var(--text-muted);
}

/* ===== STATS SECTION ===== */
.stats-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

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

.stat-group {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.stat-group h4 {
    margin: 0 0 16px 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== MATCHES SECTION ===== */
.matches-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 32px;
}

.matches-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.matches-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.matches-table th,
.matches-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.matches-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.matches-table tbody tr:hover {
    background: var(--hover-bg);
}

.match-result {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.match-result.win {
    background: rgba(40, 167, 69, 0.2);
    color: var(--success-color);
}

.match-result.loss {
    background: rgba(220, 53, 69, 0.2);
    color: var(--error-color);
}

.match-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.match-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ===== PERFORMANCE STATS - MAXIMUM SPECIFICITY OVERRIDE ===== */
.player-profile-page .stats-grid,
body.player-profile-page .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 16px !important;
}

.player-profile-page .stats-grid .stat-card,
body.player-profile-page .stat-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 16px !important;
    display: flex !important;
    flex-direction: column !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
}

.player-profile-page .stats-grid .stat-card h3,
body.player-profile-page .stat-card h3 {
    margin: 0 0 8px 0 !important;
    color: var(--text-muted) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
}

.player-profile-page .stats-grid .stat-value,
body.player-profile-page .stat-value {
    font-size: 1.3rem !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
    margin-bottom: 4px !important;
}

.player-profile-page .stats-grid .stat-label,
body.player-profile-page .stat-label {
    font-size: 11px !important;
    color: var(--text-secondary) !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
}

/* Performance indicators with maximum specificity */
.player-profile-page .stats-grid .stat-value.good,
.player-profile-page .stats-grid .stat-value.positive,
body.player-profile-page .stat-value.good,
body.player-profile-page .stat-value.positive {
    color: var(--success-color) !important;
}

.player-profile-page .stats-grid .stat-value.negative,
body.player-profile-page .stat-value.negative {
    color: var(--error-color) !important;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .hero-content {
        grid-template-columns: 1fr !important;
        gap: 20px;
        padding: 16px;
        text-align: center;
        height: auto !important;
    }
    
    .player-main-info {
        text-align: center;
        gap: 16px;
    }
    
    .player-top-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .player-avatar-round {
        width: 80px;
        height: 80px;
    }
    
    .player-name {
        font-size: 2.0rem !important;
    }
    
    .player-metadata {
        align-items: center;
    }
    
    .metadata-item {
        justify-content: center;
    }
    
    .spider-chart-container {
        height: 300px !important;
    }
    
    #playerRadarChart {
        width: 280px !important;
        height: 240px !important;
    }
    
    .toltov-panel {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-stats-bar {
        grid-template-columns: 1fr;
    }
    
    .matches-table {
        font-size: 14px;
    }
    
    .matches-table th,
    .matches-table td {
        padding: 8px 12px;
    }
    
    .rating-row {
        grid-template-columns: 60px 80px 60px 1fr;
        gap: 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding: 16px;
    }
    
    .player-avatar-round {
        width: 60px;
        height: 60px;
    }
    
    .player-name {
        font-size: 1.8rem !important;
    }
    
    .metadata-item {
        font-size: 12px;
    }
    
    .elo-info .elo-value {
        font-size: 14px;
    }
    
    .spider-chart-container {
        height: 250px !important;
        padding: 15px !important;
    }
    
    #playerRadarChart {
        width: 220px !important;
        height: 200px !important;
    }
    
    .toltov-value {
        font-size: 36px;
    }
    
    .stats-section,
    .matches-section,
    .match-controls {
        padding: 16px;
    }
    
    .slider-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .matches-table {
        font-size: 12px;
    }
    
    .matches-table th,
    .matches-table td {
        padding: 6px 8px;
    }
}

/* Chart container positioning */
.spider-chart-container {
    position: relative;
}
