/* Counter-Strike 2 - Web Design System */
:root {
    --cs2-orange: #de9b35;
    --cs2-orange-bright: #ff6600;
    --cs2-blue: #5d79ae;
    --cs2-dark-bg: #1b1e24;
    --cs2-darker-bg: #0d1015;
    --cs2-card-bg: rgba(30, 35, 45, 0.6);
    --cs2-text-primary: #ffffff;
    --cs2-text-secondary: #b2b2b2;
    --cs2-border: rgba(255, 255, 255, 0.1);
    --cs2-glass-border: 1px solid rgba(255, 255, 255, 0.05);
    --cs2-font-primary: 'Stratum2', 'Inter', 'Segoe UI', sans-serif;
    /* Stratum2 is the game font, fallback to Inter */
}

@font-face {
    font-family: 'Stratum2';
    src: local('Agency FB'), local('Stratum2'), sans-serif;
    /* Fallback to Agency FB if Stratum2 is not available */
}

body {
    background-color: var(--cs2-darker-bg);
    background-image: url('https://cdn.akamai.steamstatic.com/apps/csgo/images/csgo_react/cs2/header_bg.svg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--cs2-text-primary);
    font-family: var(--cs2-font-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

/* Gradient Overlay for Background readability */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(13, 16, 21, 0.85) 0%, rgba(13, 16, 21, 0.95) 100%);
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Header & Nav */
.nav-header {
    background: rgba(13, 16, 21, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--cs2-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-brand {
    font-size: 24px;
    font-weight: bold;
    color: var(--cs2-orange);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-item {
    color: var(--cs2-text-secondary);
    text-decoration: none;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item:hover,
.nav-item.active {
    color: #fff;
    background: var(--cs2-orange);
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
    color: var(--cs2-text-primary);
    text-transform: uppercase;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

h2 {
    font-size: 2rem;
    color: var(--cs2-orange);
    border-left: 4px solid var(--cs2-orange);
    padding-left: 15px;
}

/* Cards & Containers */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.cs2-card {
    background: var(--cs2-card-bg);
    backdrop-filter: blur(10px);
    border: var(--cs2-glass-border);
    padding: 20px;
    border-radius: 2px;
    /* Slight rounded for modern feel, but keep CS strictness */
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.cs2-card:hover {
    transform: translateY(-2px);
    border-color: var(--cs2-orange);
}

.cs2-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cs2-orange);
    opacity: 0;
    transition: opacity 0.2s;
}

.cs2-card:hover::after {
    opacity: 1;
}

/* Tables */
.cs2-table-wrapper {
    background: var(--cs2-card-bg);
    backdrop-filter: blur(10px);
    border: var(--cs2-glass-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

table.cs2-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--cs2-text-secondary);
}

table.cs2-table th {
    background: rgba(0, 0, 0, 0.4);
    color: var(--cs2-orange);
    text-transform: uppercase;
    font-size: 13px;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

table.cs2-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

table.cs2-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.rank-cell {
    font-weight: bold;
    font-size: 1.2rem;
}

.rank-1 {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.rank-2 {
    color: #c0c0c0;
}

.rank-3 {
    color: #cd7f32;
}

/* New Utilities */
.text-orange {
    color: var(--cs2-orange);
}

.text-blue {
    color: var(--cs2-blue);
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

.flex-game {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Graph Canvas */
.chart-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

/* Breadcrumbs */
.breadcrumb {
    color: var(--cs2-text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--cs2-orange);
    text-decoration: none;
}

.breadcrumb span {
    color: #fff;
    opacity: 0.5;
    margin: 0 5px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: #555;
    font-size: 12px;
    text-transform: uppercase;
    margin-top: 50px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    /* Header Stacking */
    .nav-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-links {
        gap: 10px;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Stats Profile Header */
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .profile-meta {
        order: 2;
    }

    .avatar-big {
        order: 1;
        margin: 0 auto;
    }

    .profile-highlight {
        order: 3;
        margin: 0 auto !important;
        text-align: center !important;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* Table Handling */
    .cs2-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.cs2-table th,
    table.cs2-table td {
        padding: 10px 8px;
        font-size: 0.85rem;
    }

    /* Cards */
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .stat-value {
        font-size: 1.4rem !important;
    }
}

/* Icon Coloring */
.cs2-icon-filtered {
    /* Target: #de9b35 (CS2 Orange) */
    filter: brightness(0) saturate(100%) invert(66%) sepia(81%) saturate(1588%) hue-rotate(352deg) brightness(101%) contrast(106%);
    transition: filter 0.3s;
}

.cs2-card:hover .cs2-icon-filtered {
    /* Brighten on hover: #ff6600 */
    filter: brightness(0) saturate(100%) invert(53%) sepia(61%) saturate(2385%) hue-rotate(1deg) brightness(103%) contrast(105%);
}

/* Buttons */
.cs2-button {
    background: transparent;
    border: 1px solid var(--cs2-orange);
    color: var(--cs2-orange);
    padding: 8px 16px;
    text-transform: uppercase;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: inline-block;
}

.cs2-button:hover {
    background: var(--cs2-orange);
    color: #fff;
    box-shadow: 0 0 10px rgba(222, 155, 53, 0.5);
}

/* Pagination */
.cs2-pagination-wrapper {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.cs2-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--cs2-text-secondary);
    text-decoration: none;
    border-radius: 4px;
    /* Fallback */
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s ease;
    clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
    min-width: 40px;
    height: 36px;
    box-sizing: border-box;
    border: none;
}

.cs2-pagination-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
}

.cs2-pagination-btn.active {
    background: var(--cs2-orange);
    color: #fff;
    pointer-events: none;
}

.cs2-pagination-btn.disabled {
    background: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.2);
    cursor: default;
    pointer-events: none;
}

.cs2-pagination-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #555;
    padding: 0 5px;
    font-weight: bold;
}

/* Footer Links */
.footer-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 600;
}

.footer-link:hover {
    color: var(--cs2-orange);
    text-decoration: none;
}

/* StatTrak™ Widget */
.stattrak-module {
    background: linear-gradient(180deg, #4a4a4a 0%, #2b2b2b 100%);
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    padding: 6px;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    width: fit-content;
    line-height: normal;
}

.st-display {
    background: #000;
    padding: 4px;
    /* Reduced padding */
    border: 1px solid #111;
    border-radius: 2px;
    display: flex;
    gap: 2px;
    /* Reduced gap between digits */
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    position: relative;
    height: 24px;
    /* Matches 7*2 + gap adjustments approx */
}

.st-display::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    pointer-events: none;
    z-index: 2;
}

.st-digit {
    display: grid;
    grid-template-columns: repeat(5, 2px);
    /* 2px width cells */
    grid-template-rows: repeat(7, 2px);
    /* 2px height cells */
    gap: 1px;
    /* Minimal gap */
}

.st-cell {
    width: 2px;
    height: 2px;
    background-color: #3d1400;
    border-radius: 0;
    display: block;
}

.st-cell.active {
    background-color: #ffaa00;
    box-shadow: 0 0 2px rgba(255, 170, 0, 0.8);
    /* Tighter glow */
    z-index: 1;
}

.st-label-plate {
    margin-top: 4px;
    padding: 2px 5px;
    background: #555;
    border: 1px solid #222;
    border-radius: 1px;
    color: #ccc;
    font-family: 'Arial', sans-serif;
    font-size: 10px;
    font-weight: bold;
    font-style: italic;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
    display: inline-block;
    background: linear-gradient(90deg, #666 0%, #444 100%);
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.st-logo {
    letter-spacing: 0.5px;
}

.st-tm {
    font-size: 8px;
    vertical-align: super;
}

/* StatTrak Toggle Logic */
.stattrak-wrapper {
    display: inline-block;
    transition: all 0.3s ease;
}

/* When OFF (no .active class on wrapper), force all cells to dark */
.stattrak-wrapper:not(.active) .st-cell.active {
    background-color: #3d1400 !important;
    box-shadow: none !important;
}

.stattrak-wrapper:not(.active) .st-display {
    box-shadow: inset 0 0 20px #000;
    /* Darker screen when off */
}

.stattrak-wrapper:not(.active) .stattrak-module {
    opacity: 0.7;
}

/* When ON (.active class present), ensure active cells are bright */
.stattrak-wrapper.active .st-cell.active {
    background-color: #ffaa00 !important;
    box-shadow: 0 0 4px rgba(255, 170, 0, 0.6) !important;
}