/* ==========================================
   PROFILE PAGE
   ========================================== */

.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

/* Profile Header */
.profile-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-2xl);
    background: linear-gradient(135deg, rgba(30, 35, 50, 0.8), rgba(20, 25, 40, 0.9));
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--accent-primary);
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
}

.profile-username {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.btn-follow {
    padding: 12px 32px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-follow:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-follow.following {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* Game Tabs */
.game-tabs {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-2xl);
}

.tab-btn {
    flex: 1;
    max-width: 300px;
    padding: var(--spacing-lg);
    background: rgba(30, 35, 50, 0.6);
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.tab-btn:hover {
    background: rgba(40, 45, 60, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.tab-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

/* Stats Container */
.stats-container {
    min-height: 400px;
}

.profile-stats-overview {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xl);
}

.loading,
.error,
.no-data {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
    font-size: 16px;
}

.error {
    color: var(--error);
}

/* ==========================================
   CS2 STATS
   ========================================== */

.cs2-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

/* Last Matches */
.last-matches-section {
    background: rgba(30, 35, 50, 0.6);
    border-radius: 8px;
    padding: var(--spacing-xl);
}

.last-matches-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 var(--spacing-lg) 0;
    text-transform: none;
}

.matches-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.match-item {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(20, 25, 40, 0.6);
    border-radius: 6px;
}

.map-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
}

.map-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.match-date {
    font-size: 12px;
    color: var(--text-muted);
}

.match-score {
    font-size: 13px;
    font-weight: 600;
}

.match-score.win {
    color: #10b981;
}

.match-score.loss {
    color: #ef4444;
}

/* Performance Metrics */
.performance-metrics {
    display: flex;
    gap: var(--spacing-lg);
    align-items: flex-start;
}

.metric-card {
    text-align: center;
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.circular-stat {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto var(--spacing-sm);
}

.circular-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.circle-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s;
}

.circular-chart.green .circle-progress {
    stroke: #10b981;
}

.circular-chart.orange .circle-progress {
    stroke: #f59e0b;
}

.stat-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Small T/CT Ratings */
.small-ratings {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.small-rating {
    text-align: center;
}

.small-circle {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 4px;
}

.small-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.small-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3;
}

.small-circle-progress {
    fill: none;
    stroke: #03cafc;
    stroke-width: 3;
    stroke-linecap: round;
}

.small-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.small-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Stack Breakdown */
.stack-breakdown {
    grid-column: 1 / -1;
    background: rgba(30, 35, 50, 0.6);
    border-radius: 8px;
    padding: var(--spacing-lg);
}

.stack-labels {
    display: flex;
    justify-content: space-around;
    margin-bottom: var(--spacing-md);
}

.stack-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stack-icon {
    font-size: 16px;
}

.stack-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.stack-percent {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.stack-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    display: flex;
    overflow: hidden;
}

.stack-segment {
    height: 100%;
    transition: width 0.3s;
}

.stack-segment.solo {
    background: #3b82f6;
}

.stack-segment.stack2_4 {
    background: #10b981;
}

.stack-segment.stack5 {
    background: #f59e0b;
}

/* ==========================================
   LOL STATS
   ========================================== */

.lol-stats-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: var(--spacing-xl);
}

.lol-left-col,
.lol-right-col {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Rank Card */
.rank-card {
    background: rgba(30, 35, 50, 0.6);
    border-radius: 8px;
    padding: var(--spacing-xl);
    text-align: center;
}

.rank-mode {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.rank-tier {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.rank-lp {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.rank-change {
    font-size: 12px;
    color: #10b981;
    margin-bottom: var(--spacing-lg);
}

.rank-winrate {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-sm);
}

.rank-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.rank-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3;
}

.rank-circle-progress {
    fill: none;
    stroke: #10b981;
    stroke-width: 3;
    stroke-linecap: round;
}

.rank-wr-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.rank-wr-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Role Breakdown */
.role-breakdown {
    background: rgba(30, 35, 50, 0.6);
    border-radius: 8px;
    padding: var(--spacing-lg);
}

.role-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.role-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.role-icons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.role-item {
    text-align: center;
}

.role-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 4px;
}

.role-count {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Last Game */
.last-game {
    background: rgba(30, 35, 50, 0.6);
    border-radius: 8px;
    padding: var(--spacing-lg);
}

.last-game-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.last-game-time {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.last-game-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.last-game-champ {
    width: 60px;
    height: 60px;
    border-radius: 8px;
}

.last-game-stats {
    flex: 1;
}

.last-game-kda {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.last-game-rating {
    font-size: 12px;
    color: var(--text-secondary);
}

.last-game-result {
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.last-game-result.win {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.last-game-result.loss {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Recent Performance */
.recent-performance {
    background: rgba(30, 35, 50, 0.6);
    border-radius: 8px;
    padding: var(--spacing-xl);
}

.perf-header {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.perf-role,
.perf-position {
    font-size: 12px;
    color: var(--text-secondary);
}

.perf-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.perf-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.perf-circle {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto var(--spacing-md);
}

.perf-chart {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.perf-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.perf-progress {
    fill: none;
    stroke: #f97316;
    stroke-width: 8;
    stroke-linecap: round;
}

.perf-value {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    font-weight: 700;
    color: #f97316;
}

.perf-label {
    font-size: 13px;
    color: var(--text-muted);
}

.perf-info {
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--accent-primary);
    text-decoration: none;
    margin-bottom: var(--spacing-xl);
}

/* Category Bars */
.category-bars {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.category-bar {
    display: grid;
    grid-template-columns: 120px 1fr 40px;
    align-items: center;
    gap: var(--spacing-md);
}

.cat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.cat-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.cat-fill {
    height: 100%;
    background: linear-gradient(90deg, #03cafc, #0ea5e9);
    border-radius: 3px;
    transition: width 0.3s;
}

.cat-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

/* Top Champs */
.top-champs {
    background: rgba(30, 35, 50, 0.6);
    border-radius: 8px;
    padding: var(--spacing-lg);
}

.top-champs-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.top-champs-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.champs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.champ-card {
    text-align: center;
}

.champ-img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
}

.champ-winrate {
    font-size: 14px;
    font-weight: 700;
    color: #10b981;
}

.champ-games {
    font-size: 11px;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {

    .cs2-stats-grid,
    .lol-stats-grid {
        grid-template-columns: 1fr;
    }

    .performance-metrics {
        flex-wrap: wrap;
    }

    .champs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}