/**
 * Shared Profile Styles
 * Used by both accounts/profile.html and tournament/player_profile.html
 * Edit this file to update styles on BOTH pages simultaneously
 */

/* ============================================
   MATCH HISTORY SECTION
   ============================================ */
.match-history-section {
    margin-top: 2rem;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1.5rem;
}

.match-history-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #333;
}

.match-history-section .section-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
    font-family: 'Apex', sans-serif;
}

.match-count {
    color: #666;
    font-size: 0.85rem;
}

.match-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Match Row - Grid Layout */
.match-row {
    display: grid;
    grid-template-columns: 50px 100px 40px 1fr 120px;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border-left: 3px solid #444;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.match-row:hover {
    background: rgba(255,255,255,0.05);
}

.match-row.win {
    border-left-color: #4ade80;
    background: rgba(74, 222, 128, 0.05);
}

.match-row.top3 {
    border-left-color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
}

.match-row.top5 {
    border-left-color: #60a5fa;
    background: rgba(96, 165, 250, 0.05);
}

/* Game Link */
.match-number {
    text-align: center;
}

.game-link {
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #666;
    transition: color 0.2s ease;
}

.game-link:hover {
    color: #f4012b;
}

.game-link:hover .game-num {
    color: #f4012b;
}

.game-link-icon {
    font-size: 0.65rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.game-link:hover .game-link-icon {
    opacity: 1;
}

.game-num {
    font-size: 0.85rem;
    color: #666;
    font-weight: bold;
    transition: color 0.2s ease;
}

/* Placement */
.match-placement {
    text-align: center;
}

.placement-num {
    font-size: 1.25rem;
    font-weight: bold;
    color: #888;
    font-family: 'Apex', sans-serif;
}

.match-row.win .placement-num {
    color: #4ade80;
}

.match-row.top3 .placement-num {
    color: #fbbf24;
}

.match-row.top5 .placement-num {
    color: #60a5fa;
}

/* Match Info */
.match-info {
    display: flex;
    flex-direction: column;
}

.match-date {
    color: #fff;
    font-size: 0.85rem;
}

/* Legend Icon Column */
.match-legend-col {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 0 0.5rem;
}

.match-legend-col .legend-icon {
    width: 26px;
    height: 26px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.match-row:hover .match-legend-col .legend-icon {
    opacity: 1;
    transform: scale(1.15);
}

.match-legend {
    color: #888;
    font-size: 0.75rem;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.match-legend .legend-icon {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.match-row:hover .match-legend .legend-icon {
    filter: brightness(0) invert(1);
    transform: scale(1.1);
}

.match-legend.team-comp {
    color: #3b82f6;
    font-style: normal;
}

.match-legend.team-comp i {
    margin-right: 4px;
}

/* Match Stats */
.match-stats {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.match-stat {
    text-align: center;
    min-width: 40px;
}

.match-stat .stat-num {
    display: block;
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
    font-family: 'Apex', sans-serif;
}

.match-stat .stat-type {
    display: block;
    color: #666;
    font-size: 0.65rem;
    text-transform: uppercase;
}

.match-stat.points .stat-num {
    color: #4ade80;
}

.match-stat.points .stat-num.negative {
    color: #ef4444;
}

/* Loss Forgiveness Color */
.match-stat.points .stat-num.loss-forgiven {
    color: #7dd3fc;
}

/* Match Teammates */
.match-teammates {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 100px;
}

.teammate-name {
    color: #888;
    font-size: 0.8rem;
}

.no-teammates {
    color: #555;
    font-size: 0.8rem;
    font-style: italic;
}

/* No Matches */
.no-matches {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* Match History Pagination */
.match-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(244, 1, 43, 0.2);
    border-color: #f4012b;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    color: #888;
    font-size: 0.85rem;
}

/* ============================================
   SESSION HISTORY SECTION
   ============================================ */
.session-history-section {
    margin-top: 2rem;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1.5rem;
}

.session-history-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #333;
}

.session-history-section .section-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
    font-family: 'Apex', sans-serif;
}

.session-count {
    color: #666;
    font-size: 0.85rem;
}

.session-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.session-row {
    display: grid;
    grid-template-columns: 60px 1fr auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border-left: 3px solid #444;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.session-row:hover {
    background: rgba(255,255,255,0.05);
    transform: translateX(4px);
}

.session-row.win {
    border-left-color: #4ade80;
    background: rgba(74, 222, 128, 0.05);
}

.session-row.top3 {
    border-left-color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
}

.session-row.top5 {
    border-left-color: #60a5fa;
    background: rgba(96, 165, 250, 0.05);
}

.session-placement .placement-num {
    font-size: 1.25rem;
    font-weight: bold;
    color: #888;
    font-family: 'Apex', sans-serif;
}

.session-row.win .session-placement .placement-num {
    color: #4ade80;
}

.session-row.top3 .session-placement .placement-num {
    color: #fbbf24;
}

.session-row.top5 .session-placement .placement-num {
    color: #60a5fa;
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.session-date {
    color: #fff;
    font-size: 0.95rem;
}

.session-division {
    font-size: 0.75rem;
    color: #888;
}

.session-stats {
    display: flex;
    gap: 1.5rem;
}

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

.session-stat .stat-num {
    display: block;
    color: #fff;
    font-weight: bold;
    font-size: 0.95rem;
    font-family: 'Apex', sans-serif;
}

.session-stat .stat-type {
    display: block;
    color: #666;
    font-size: 0.65rem;
    text-transform: uppercase;
}

.session-badge .placement-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2) 0%, rgba(245, 158, 11, 0.2) 100%);
    color: #fbbf24;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================
   PERFORMANCE ANALYTICS / CHARTS SECTION
   ============================================ */
.performance-trends-section {
    margin-top: 2rem;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 1.5rem;
}

.performance-trends-section.full-width {
    background: transparent;
    padding: 0;
}

.performance-trends-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.performance-trends-section .section-header h2 {
    margin: 0;
    color: #fff;
    font-size: 1.25rem;
    font-family: 'Apex', sans-serif;
}

/* Chart Selector Dropdown */
.chart-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chart-selector-dropdown {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    min-width: 200px;
    transition: border-color 0.2s;
}

.chart-selector-dropdown:hover {
    border-color: #f4012b;
}

.chart-selector-dropdown:focus {
    outline: none;
    border-color: #f4012b;
}

.chart-selector-dropdown option {
    background: #1a1a1a;
    color: #fff;
    padding: 10px;
}

/* Unified Chart Container */
.unified-chart-container {
    background: #0d0d0d;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #333;
    position: relative;
    min-height: 420px;
}

.chart-panel {
    display: none;
    width: 100%;
}

.chart-panel.active {
    display: block;
}

.chart-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chart-subtitle {
    font-size: 0.8rem;
    color: #666;
}

.chart-wrapper-unified {
    width: 100%;
    height: 350px;
    position: relative;
}

.chart-wrapper-unified canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Chart Legend */
.chart-legend-inline {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #888;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color.kills { background: #f4012b; }
.legend-color.damage { background: #3b82f6; }
.legend-color.avg { background: transparent; border: 2px dashed #4ade80; }

/* ============================================
   LEGEND STATS PANEL (Inside Performance Analytics)
   ============================================ */
.legend-stats-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.legend-stats-cards-inline {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.legend-card-inline {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    border: 1px solid #333;
}

.legend-card-inline.best {
    border-color: rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.05);
}

.legend-card-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.legend-card-inline .legend-card-title {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-card-badge-inline {
    font-size: 0.65rem;
    color: #ffd700;
}

.legend-name-inline {
    font-family: 'Apex', sans-serif;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.75rem;
}

.legend-stats-row-inline {
    display: flex;
    gap: 1.5rem;
}

.legend-stat-inline {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.legend-stat-inline .stat-value {
    font-family: 'Apex', sans-serif;
    font-size: 1rem;
    color: #fff;
    font-weight: bold;
}

.legend-stat-inline.highlight .stat-value {
    color: #4ade80;
}

.legend-stat-inline .stat-label {
    font-size: 0.65rem;
    color: #666;
    text-transform: uppercase;
}

.legends-table-container {
    overflow-x: auto;
}

.legends-table-inline {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.legends-table-inline th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #333;
}

.legends-table-inline td {
    padding: 0.65rem 1rem;
    color: #fff;
    border-bottom: 1px solid #222;
}

.legends-table-inline tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.legends-table-inline .legend-name-cell {
    font-weight: 600;
    color: #fff;
}

.no-legend-data {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 1100px) {
    .match-row {
        grid-template-columns: 45px 90px 35px 1fr 100px;
    }

    .match-stats {
        gap: 0.5rem;
    }
}

@media (max-width: 900px) {
    .match-row {
        grid-template-columns: 40px 80px 30px 1fr;
    }

    .match-teammates {
        display: none;
    }

    .match-stats {
        justify-content: space-between;
    }

    .session-row {
        grid-template-columns: 50px 1fr;
        gap: 0.75rem;
    }

    .session-stats {
        display: none;
    }

    .session-badge {
        display: none;
    }

    .legend-stats-cards-inline {
        grid-template-columns: 1fr;
    }

    .legend-stats-row-inline {
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .match-row {
        grid-template-columns: 50px 40px 1fr;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    .match-info,
    .match-legend-col {
        display: none;
    }

    .match-stats {
        gap: 0.4rem;
    }

    .match-stat {
        min-width: 30px;
    }

    .match-stat .stat-num {
        font-size: 0.85rem;
    }

    .match-stat .stat-type {
        font-size: 0.55rem;
    }

    .chart-wrapper-unified {
        height: 280px;
    }

    .unified-chart-container {
        min-height: 350px;
        padding: 1rem;
    }
}

/* ============================================
   CONSOLE PLAYER STATS PENDING ALERT
   ============================================ */
.stats-pending-alert {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.stats-pending-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stats-pending-icon {
    color: #3b82f6;
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.stats-pending-text {
    flex: 1;
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.stats-pending-text strong {
    color: #fff;
    font-weight: 600;
}

.stats-pending-text small {
    color: #999;
    font-size: 0.8rem;
}

.stats-pending-retry {
    flex-shrink: 0;
}

.btn-retry-match {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 6px;
    color: #3b82f6;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-retry-match:hover {
    background: rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.6);
    color: #60a5fa;
}

.btn-retry-match i {
    font-size: 0.8rem;
}

@media (max-width: 600px) {
    .stats-pending-content {
        flex-direction: column;
        text-align: center;
    }

    .stats-pending-icon {
        margin-top: 0;
    }

    .stats-pending-retry {
        width: 100%;
    }

    .btn-retry-match {
        width: 100%;
        justify-content: center;
    }
}


