/**
 * CS 1.6 Clanwars Styles
 * Team-Exciting Gaming Community
 */

/* ============================================
   CSS Variables
   ============================================ */
:root {
    --cs16-primary: #FF6B00;
    --cs16-secondary: #1A1A2E;
    --cs16-accent: #00D4FF;
    --cs16-success: #00FF7F;
    --cs16-danger: #FF4757;
    --cs16-warning: #FFD93D;
    --cs16-bg-dark: #0F0F1A;
    --cs16-bg-card: #16162A;
    --cs16-bg-hover: #1E1E3A;
    --cs16-text: #E8E8E8;
    --cs16-text-muted: #8888AA;
    --cs16-border: #2A2A4A;
    --cs16-team1: #FF4444;
    --cs16-team2: #4488FF;
    --cs16-radius: 8px;
    --cs16-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Base Styles
   ============================================ */
.cs16-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--cs16-primary);
}

.cs16-section-header h3 {
    margin: 0;
    color: var(--cs16-text);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cs16-error {
    padding: 1rem;
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--cs16-danger);
    border-radius: var(--cs16-radius);
    color: var(--cs16-danger);
    text-align: center;
}

.cs16-no-data {
    text-align: center;
    color: var(--cs16-text-muted);
    padding: 2rem;
}

/* ============================================
   Mode Toggle
   ============================================ */
.cs16-mode-toggle {
    display: flex;
    gap: 0.5rem;
}

.cs16-mode-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--cs16-border);
    border-radius: var(--cs16-radius);
    color: var(--cs16-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.cs16-mode-btn:hover {
    border-color: var(--cs16-primary);
    color: var(--cs16-primary);
}

.cs16-mode-btn.active {
    background: var(--cs16-primary);
    border-color: var(--cs16-primary);
    color: #fff;
}

/* ============================================
   Tables
   ============================================ */
.cs16-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--cs16-bg-card);
    border-radius: var(--cs16-radius);
    overflow: hidden;
}

.cs16-table thead {
    background: var(--cs16-secondary);
}

.cs16-table th {
    padding: 1rem;
    text-align: left;
    color: var(--cs16-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.cs16-table tbody tr {
    border-bottom: 1px solid var(--cs16-border);
    transition: background 0.2s;
}

.cs16-table tbody tr:hover {
    background: var(--cs16-bg-hover);
}

.cs16-table tbody tr.team-member {
    background: rgba(255, 107, 0, 0.05);
}

.cs16-table td {
    padding: 0.875rem 1rem;
    color: var(--cs16-text);
}

.cs16-table .rank {
    font-weight: 700;
    color: var(--cs16-primary);
    width: 50px;
}

.cs16-table .player a {
    color: var(--cs16-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cs16-table .player a:hover {
    color: var(--cs16-primary);
}

.cs16-table .stat {
    font-family: 'Fira Code', monospace;
    font-weight: 500;
}

.cs16-table .stat.positive {
    color: var(--cs16-success);
}

.cs16-table .stat.negative {
    color: var(--cs16-danger);
}

.team-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--cs16-primary);
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 4px;
}

.team-badge-large {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 32px;
    height: 32px;
    background: var(--cs16-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--cs16-shadow);
}

/* ============================================
   Leaderboard
   ============================================ */
.cs16-leaderboard {
    background: var(--cs16-bg-dark);
    border-radius: var(--cs16-radius);
    padding: 1.5rem;
}

/* ============================================
   Player Profile
   ============================================ */
.cs16-player-profile {
    background: var(--cs16-bg-dark);
    border-radius: var(--cs16-radius);
    padding: 2rem;
}

.cs16-player-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--cs16-border);
}

.cs16-player-avatar {
    position: relative;
    flex-shrink: 0;
}

.cs16-avatar-placeholder {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--cs16-primary), var(--cs16-secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.cs16-player-info h2 {
    margin: 0 0 0.5rem;
    color: var(--cs16-text);
    font-size: 2rem;
}

.cs16-steamid {
    font-family: 'Fira Code', monospace;
    color: var(--cs16-text-muted);
    font-size: 0.875rem;
    margin: 0 0 0.5rem;
}

.cs16-meta {
    color: var(--cs16-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Stats Grid */
.cs16-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cs16-stat-card {
    background: var(--cs16-bg-card);
    border-radius: var(--cs16-radius);
    padding: 1.5rem;
    border-left: 4px solid var(--cs16-border);
}

.cs16-stat-card.clanwar {
    border-left-color: var(--cs16-primary);
}

.cs16-stat-card.public {
    border-left-color: var(--cs16-accent);
}

.cs16-stat-card h4 {
    margin: 0 0 1rem;
    color: var(--cs16-text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.cs16-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--cs16-border);
}

.cs16-stat-row:last-child {
    border-bottom: none;
}

.cs16-stat-row .label {
    color: var(--cs16-text-muted);
}

.cs16-stat-row .value {
    font-weight: 600;
    font-family: 'Fira Code', monospace;
}

.cs16-stat-row .value.positive {
    color: var(--cs16-success);
}

.cs16-stat-row .value.negative {
    color: var(--cs16-danger);
}

/* Weapons */
.cs16-weapons {
    margin-bottom: 2rem;
}

.cs16-weapons h4 {
    margin: 0 0 1rem;
    color: var(--cs16-text);
}

.cs16-weapons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.cs16-weapon {
    background: var(--cs16-bg-card);
    border-radius: var(--cs16-radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cs16-weapon .weapon-name {
    font-weight: 600;
    color: var(--cs16-primary);
    text-transform: uppercase;
}

.cs16-weapon .weapon-kills,
.cs16-weapon .weapon-hs {
    font-size: 0.875rem;
    color: var(--cs16-text-muted);
}

/* Recent Matches */
.cs16-recent-matches h4 {
    margin: 0 0 1rem;
    color: var(--cs16-text);
}

.cs16-matches-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cs16-match-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 1rem;
    align-items: center;
    background: var(--cs16-bg-card);
    border-radius: var(--cs16-radius);
    padding: 1rem;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 4px solid transparent;
}

.cs16-match-item.won {
    border-left-color: var(--cs16-success);
}

.cs16-match-item.lost {
    border-left-color: var(--cs16-danger);
}

.cs16-match-item:hover {
    background: var(--cs16-bg-hover);
    transform: translateX(4px);
}

.cs16-match-teams {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cs16-match-teams .team1,
.cs16-match-teams .team2 {
    color: var(--cs16-text);
}

.cs16-match-teams .score {
    font-weight: 700;
    color: var(--cs16-primary);
    padding: 0 0.5rem;
}

.cs16-match-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--cs16-text-muted);
}

.cs16-match-map {
    color: var(--cs16-text-muted);
    font-size: 0.875rem;
}

/* ============================================
   Clanwars List
   ============================================ */
.cs16-clanwars {
    background: var(--cs16-bg-dark);
    border-radius: var(--cs16-radius);
    padding: 1.5rem;
}

.cs16-clanwars-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cs16-clanwar-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
    background: var(--cs16-bg-card);
    border-radius: var(--cs16-radius);
    padding: 1.25rem;
    text-decoration: none;
    transition: all 0.2s;
}

.cs16-clanwar-card:hover {
    background: var(--cs16-bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--cs16-shadow);
}

.cs16-cw-status {
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cs16-cw-status.live {
    background: var(--cs16-danger);
    color: #fff;
    animation: pulse 1.5s infinite;
}

.cs16-cw-status.finished {
    background: var(--cs16-success);
    color: #000;
}

.cs16-cw-status.pending,
.cs16-cw-status.warmup {
    background: var(--cs16-warning);
    color: #000;
}

.cs16-cw-status.paused {
    background: var(--cs16-accent);
    color: #000;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.cs16-cw-teams {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cs16-cw-team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cs16-cw-team.team1 {
    flex-direction: row;
}

.cs16-cw-team.team2 {
    flex-direction: row-reverse;
}

.cs16-cw-team .name {
    color: var(--cs16-text);
    font-weight: 600;
}

.cs16-cw-team.winner .name {
    color: var(--cs16-success);
}

.cs16-cw-team .score {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Fira Code', monospace;
    color: var(--cs16-text);
}

.cs16-cw-vs {
    color: var(--cs16-text-muted);
    font-weight: 300;
}

.cs16-cw-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: right;
    font-size: 0.875rem;
    color: var(--cs16-text-muted);
}

/* ============================================
   Clanwar Detail
   ============================================ */
.cs16-clanwar-detail {
    background: var(--cs16-bg-dark);
    border-radius: var(--cs16-radius);
    padding: 2rem;
}

.cs16-cw-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--cs16-border);
}

.cs16-cw-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.cs16-cw-score .team {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cs16-cw-score .team1 {
    align-items: flex-end;
}

.cs16-cw-score .team2 {
    align-items: flex-start;
}

.cs16-cw-score .name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--cs16-text);
}

.cs16-cw-score .team.winner .name {
    color: var(--cs16-success);
}

.cs16-cw-score .score {
    font-size: 4rem;
    font-weight: 700;
    font-family: 'Fira Code', monospace;
    line-height: 1;
}

.cs16-cw-score .team1 .score {
    color: var(--cs16-team1);
}

.cs16-cw-score .team2 .score {
    color: var(--cs16-team2);
}

.cs16-cw-score .vs {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cs16-cw-score .vs .status {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.cs16-cw-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    color: var(--cs16-text-muted);
}

/* Scoreboard */
.cs16-cw-scoreboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.cs16-team-scoreboard h4 {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--cs16-radius) var(--cs16-radius) 0 0;
}

.cs16-team-scoreboard.team1 h4 {
    background: linear-gradient(90deg, var(--cs16-team1) 0%, transparent 100%);
}

.cs16-team-scoreboard.team2 h4 {
    background: linear-gradient(90deg, transparent 0%, var(--cs16-team2) 100%);
    text-align: right;
}

.cs16-team-scoreboard .captain {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: var(--cs16-warning);
    color: #000;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 2px;
    margin-left: 0.5rem;
}

.cs16-team-scoreboard .rating {
    color: var(--cs16-primary);
    font-weight: 600;
}

/* Rounds Timeline */
.cs16-rounds {
    margin-bottom: 2rem;
}

.cs16-rounds h4 {
    margin: 0 0 1rem;
    color: var(--cs16-text);
}

.cs16-rounds-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cs16-round {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.cs16-round.team1-win {
    background: var(--cs16-team1);
}

.cs16-round.team2-win {
    background: var(--cs16-team2);
}

/* ============================================
   Live Widget
   ============================================ */
.cs16-live-widget {
    background: linear-gradient(135deg, var(--cs16-bg-card), var(--cs16-secondary));
    border-radius: var(--cs16-radius);
    padding: 1.5rem;
    border: 1px solid var(--cs16-danger);
    text-align: center;
}

.cs16-live-widget.no-match {
    border-color: var(--cs16-border);
}

.cs16-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--cs16-danger);
    font-weight: 700;
    margin-bottom: 1rem;
}

.cs16-live-indicator .pulse {
    width: 8px;
    height: 8px;
    background: var(--cs16-danger);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

.cs16-live-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.cs16-live-score .team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cs16-live-score .name {
    font-weight: 600;
    color: var(--cs16-text);
}

.cs16-live-score .score {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Fira Code', monospace;
    color: var(--cs16-primary);
}

.cs16-live-score .vs {
    color: var(--cs16-text-muted);
}

.cs16-live-info {
    display: flex;
    justify-content: center;
    gap: 1rem;
    color: var(--cs16-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.cs16-live-link {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: var(--cs16-primary);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s;
}

.cs16-live-link:hover {
    background: #FF8533;
}

/* ============================================
   Server Widget
   ============================================ */
.cs16-server-widget {
    background: var(--cs16-bg-card);
    border-radius: var(--cs16-radius);
    padding: 1.5rem;
}

.cs16-server-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cs16-server-status .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.cs16-server-status.online .status-dot {
    background: var(--cs16-success);
    box-shadow: 0 0 8px var(--cs16-success);
}

.cs16-server-status.offline .status-dot {
    background: var(--cs16-danger);
}

.cs16-server-status .status-text {
    font-weight: 600;
    text-transform: uppercase;
}

.cs16-server-status.online .status-text {
    color: var(--cs16-success);
}

.cs16-server-status.offline .status-text {
    color: var(--cs16-danger);
}

.cs16-server-info {
    margin-bottom: 1rem;
}

.cs16-server-info .info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--cs16-border);
}

.cs16-server-info .label {
    color: var(--cs16-text-muted);
}

.cs16-server-info .value {
    color: var(--cs16-text);
    font-weight: 500;
}

.cs16-connect-btn {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: var(--cs16-primary);
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s;
}

.cs16-connect-btn:hover {
    background: #FF8533;
}

.cs16-server-loading {
    text-align: center;
    color: var(--cs16-text-muted);
    padding: 1rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .cs16-cw-scoreboard {
        grid-template-columns: 1fr;
    }

    .cs16-player-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cs16-cw-score {
        flex-direction: column;
        gap: 1rem;
    }

    .cs16-cw-score .team {
        flex-direction: row;
        gap: 1rem;
    }

    .cs16-cw-score .team1,
    .cs16-cw-score .team2 {
        align-items: center;
    }

    .cs16-clanwar-card {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cs16-cw-info {
        text-align: left;
        flex-direction: row;
        justify-content: space-between;
    }

    .cs16-table {
        font-size: 0.875rem;
    }

    .cs16-table th,
    .cs16-table td {
        padding: 0.5rem;
    }
}
