/* ========================================
   GLOBAL STYLES & VARIABLES
   ======================================== */

:root {
    /* Backgrounds */
    --primary-dark: #1a1a1a;
    --secondary-dark: #272727;
    --card-bg: #262626;
    --bg-tertiary: #2b2b2b;
    --hover-bg: #303030;
    --border-color: #353535;
    --my-rank-ackgrounds: #121212;

    /* Accent (Gold) */
    --accent-gold: #d1a85a;
    --accent-gold-hover: #e0b76a;
    --accent-gold-dark: #b08a45;
    --text-accent: #d1a85a;

    /* Text */
    --text-primary: #e6e8ef;
    --text-secondary: #b0b0b0;

    /* Rows */
    --user-row: #3b3b3b;
    --friend-row: #5f9f7a;

    /* Status */
    --success: #4f8f6f;
    --warning: #c9a24d;
    --danger: #8f3a3a;
    --info: #5a7fb8;
    --loading: #999;

    /* Tiers */
    --tier-s: #9d7bff;
    --tier-a: #5a8bff;
    --tier-b: #4caf7a;
    --tier-c: #f0a23a;
    --tier-d: #f05a5a;

    /* Charts */
    --pickrate: #facc15;
    --winrate: #5fd89a;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    background-color: var(--primary-dark);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

a {
    text-decoration: none;
}

/* ========================================
   CONTAINER & LAYOUT
   ======================================== */

.container {
    max-width: min(1200px, 95vw);
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 20px);
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

.header {
    background-color: var(--secondary-dark);
    border-bottom: 2px solid var(--accent-gold);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    color: var(--accent-gold);
    text-decoration: none;
}

.logo-icon {
    width: 65px;
    height: 65px;
    object-fit: contain;
    display: block;
}

.logo-text {
    font-size: 35px;
    letter-spacing: 1px;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-button {
    background-color: var(--accent-gold);
    color: var(--primary-dark);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.25s ease-in-out;
    border: none;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.nav-link:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 15px rgba(0,0,0,0.35);
    border-bottom-color: var(--accent-gold);
}

.nav-link.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
}

.nav-button:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 15px rgba(0,0,0,0.35);
    background-color: var(--accent-gold-hover);
}

.flag-icon {
    height: 35px;
    width: 35px;
    background-color: var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}

.flag-icon:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 15px rgba(0,0,0,0.35);
    background-color: var(--accent-gold-hover);
}

.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    cursor: pointer;
    padding-bottom: 6px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--secondary-dark);
    border: 2px solid var(--accent-gold);
    border-radius: 4px;
    min-width: max-content;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.dropdown-menu form {
    width: 100%;
}

.dropdown-item {
    display: block;
    padding: 0.4rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: none;
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    cursor: pointer;
}

.lang-flag {
    width: 20px;
    height: 14px;
    flex-shrink: 0;
}

.lang-text {
    line-height: 1;
}

.dropdown-item:hover {
    background-color: rgba(255, 215, 0, 0.1);
    color: var(--accent-gold);
}

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

.dropdown:hover .dropdown-menu {
    display: flex;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main {
    min-height: calc(100vh - 120px);
    padding: 2rem 0;
}

/* ========================================
   SECTIONS & TITLES
   ======================================== */

.page-header {
    background: var(--secondary-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-bottom: 2rem;
    text-align: center;
}

.page-title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: var(--accent-gold);
    font-weight: bold;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

.section-title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--accent-gold);
    font-weight: bold;
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

/* ========================================
   FEATURES SECTION
   ======================================== */

.features-section {
    padding: 2rem 0;
    margin-bottom: 3rem;
}

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

.feature-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-card:hover {
    background-color: var(--hover-bg);
    border-color: var(--accent-gold);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ========================================
   HEROES SECTION
   ======================================== */

.hero-table-section {
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.hero-data-table, .hero-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.hero-data-table thead, .hero-table thead {
    background-color: var(--secondary-dark);
    border-bottom: 2px solid var(--accent-gold);
}

.hero-data-table thead th, .hero-table thead th {
    padding: 1rem;
    text-align: left;
    color: var(--accent-gold);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.hero-table thead th a {
    color: inherit !important;
    text-decoration: none;
}

.hero-data-table tbody tr, .hero-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.hero-data-table tbody td, .hero-table tbody td {
    padding: 1rem;
}

.hero-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-icon-wrapper {
    position: relative;
    width: 50px;
    height: 30px;
    flex-shrink: 0;
}

.hero-icon {
    width: 50px;
    height: 30px;
    border-radius: 4px;
    display: block;
}

.hero-facet-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.facet-badge-wrapper {
    position: absolute;
    bottom: -6px;
    right: -8px;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 6px rgba(0,0,0,0.5),
        inset 0 0 6px rgba(255,255,255,0.15);
}

.facet-badge-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 6px;
    opacity: 0.65;
    z-index: 0;
}

.facet-badge-wrapper img {
    width: 16px;
    height: 16px;
    position: relative;
    z-index: 1;
}

.facet-name {
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
}

.facet-color-blue {
    background: rgba(0, 122, 255, 0.25);
    color: #68a8ff;
}
.facet-color-yellow {
    background: rgba(255, 215, 0, 0.25);
    color: #e8d46b;
}
.facet-color-red {
    background: rgba(255, 80, 80, 0.25);
    color: #ff6d6d;
}
.facet-color-green {
    background: rgba(60, 179, 113, 0.25);
    color: #7ddf9f;
}
.facet-color-purple {
    background: rgba(128, 0, 255, 0.25);
    color: #c293ff;
}
.facet-color-gray {
    background: rgba(128, 128, 128, 0.25);
    color: #bfbfbf;
}

.color-purple::before {
    background: linear-gradient(145deg, #b988c3, #7b4d88);
}
.color-yellow::before {
    background: linear-gradient(145deg, #ffe08a, #c6a539);
}
.color-red::before {
    background: linear-gradient(145deg, #ff9a9a, #b94b4b);
}
.color-blue::before {
    background: linear-gradient(145deg, #87baff, #3d6fb3);
}
.color-gray::before {
    background: linear-gradient(145deg, #cfcfcf, #8e8e8e);
}
.color-green::before {
    background: linear-gradient(145deg, #9ee6b1, #4a9b57);
}

.hero-sub {
    font-size: 12px;
    color: #bbb;
    padding-left: 8px;
}

.hero-text {
    display: flex;
    padding-left: 4px;
    flex-direction: column;
    gap: 4px;
    line-height: 1.1;
}

.hero-winrate {
    color: var(--winrate);
}

.hero-pickrate {
    color: var(--pickrate);
}

.tier-s {
    color: var(--tier-s);
    font-weight: bold;
}

.tier-a {
    color: var(--tier-a);
    font-weight: bold;
}

.tier-b {
    color: var(--tier-b);
    font-weight: bold;
}

.tier-c {
    color: var(--tier-c);
    font-weight: bold;
}

.tier-d {
    color: var(--tier-d);
    font-weight: bold;
}

.tier-nr {
    color: var(--text-secondary);
    font-weight: bold;
}

.filter-row {
    display: flex;
    gap: 15px;
}

.filter-bar {
    background-color: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.filter-bar--date {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.filter-bar--group {
    flex: 0 0 auto;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-bar--group .tag.active {
    background-color: rgba(255, 196, 90, 0.1);
}

.filter-label {
    font-weight: 600;
    color: var(--accent-gold);
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 6px 16px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag.active {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

.tag:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

.arrow {
    margin-left: 1px;
    font-size: 12px;
    vertical-align: 1.5px;
}

/* ========================================
   STATS CARDS SECTION
   ======================================== */

.stats-cards-section {
    padding-top: 2rem;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--accent-gold);
    background-color: var(--hover-bg);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.user-avatar {
    width: 65px;
    height: 65px;
    border-radius: 15%;
    margin: 0 auto 1rem;
    display: block;
    object-fit: cover;
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2rem;
    color: var(--accent-gold);
    font-weight: bold;
}

.text-green {
    color: var(--success);
    font-weight: bold;
}

.text-red {
    color: var(--danger);
    font-weight: bold;
}

.kda {
    font-weight: bold;
    white-space: nowrap;
}

.k {
    color: var(--success);
}

.d {
    color: var(--danger);
}

.a {
    color: var(--info);
}

/* ========================================
   TABLE SECTION
   ======================================== */

.table-section {
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.data-table, .leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.data-table thead, .leaderboard-table thead {
    background-color: var(--secondary-dark);
    border-bottom: 2px solid var(--accent-gold);
}

.data-table thead th, .leaderboard-table thead th {
    padding: 1rem;
    text-align: left;
    color: var(--accent-gold);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.data-table tbody tr, .leaderboard-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.data-table tbody tr:hover, .leaderboard-table tbody tr:hover:not(.user-row) {
    background-color: transparent;
}

.data-table tbody td, .leaderboard-table tbody td {
    padding: 1rem;
    color: var(--text-primary);
}

.leaderboard-table tbody tr.rank-1 {
    background-color: rgba(212, 165, 116, 0.1);
}

.leaderboard-table tbody tr.rank-2 {
    background-color: rgba(192, 192, 192, 0.05);
}

.leaderboard-table tbody tr.rank-3 {
    background-color: rgba(205, 127, 50, 0.05);
}

.leaderboard-loader {
    text-align: center;
    padding: 1.5rem;
    color: var(--loading);
    font-size: 14px;
}

.medal {
    margin-right: 0.5rem;
}

.rating-high {
    color: var(--accent-gold);
    font-weight: bold;
}

.user-row {
    background-color: var(--user-row);
}

.friend-row {
    color: var(--friend-row) !important;
}

.my-rank-wrapper {
    position: sticky;
    bottom: 0;
    margin-top: 1rem;
    border-top: 2px solid var(--hover-bg);
    background: var(--my-rank-ackgrounds);
    box-shadow: 0 -6px 16px rgba(0,0,0,.4);
}

.my-rank-table tr {
    background: var(--user-row);
}

.my-rank-table td {
    font-weight: 600;
}

.hidden {
    display: none;
}

/* ========================================
   PAGINATION
   ======================================== */

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    text-decoration: none;
}

.pagination .current {
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--accent-gold-dark);
    color: var(--text-primary);
    font-weight: bold;
}

/* ========================================
   ABOUT SECTION
   ======================================== */

.about-section {
    padding: 2rem 0;
}

.about-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
}

.about-text {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.about-feature {
    background-color: var(--hover-bg);
    border-left: 3px solid var(--accent-gold);
    padding: 1.5rem;
    border-radius: 4px;
}

.about-feature h3 {
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.about-feature p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.contact-info {
    background-color: var(--hover-bg);
    border-left: 3px solid var(--accent-gold);
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 1.5rem;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.contact-info strong {
    color: var(--text-primary);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background-color: var(--secondary-dark);
    border-top: 2px solid var(--accent-gold);
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .features-grid,
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .data-table, .leaderboard-table, .hero-data-table, .hero-table {
        font-size: 0.9rem;
        overflow-x: auto;
        display: block;
    }

    .data-table thead th, .leaderboard-table thead th, .hero-data-table thead th, .hero-table thead th {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .data-table tbody td, .leaderboard-table tbody td, .hero-data-table tbody td, .hero-table tbody td {
        padding: 0.75rem;
    }

    .filter-row {
        flex-direction: column;
        gap: 10px;
    }

    .filter-group {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .logo {
        gap: 6px;
        font-size: 16px;
    }

    .logo-icon {
        width: 50px;
        height: 50px;
    }

    .logo-text {
        font-size: 24px;
    }

    .nav {
        gap: 0.5rem;
        flex-direction: column;
        width: 100%;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 0.75rem 0;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .features-grid,
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card,
    .stat-card {
        padding: 1.5rem;
    }

    .data-table, .leaderboard-table, .hero-data-table, .hero-table {
        font-size: 0.8rem;
        overflow-x: auto;
        display: block;
    }

    .data-table thead th, .leaderboard-table thead th, .hero-data-table thead th, .hero-table thead th {
        padding: 0.5rem;
        font-size: 0.7rem;
    }

    .data-table tbody td, .leaderboard-table tbody td, .hero-data-table tbody td, .hero-table tbody td {
        padding: 0.5rem;
    }

    .hero-cell {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .hero-icon-wrapper {
        width: 40px;
        height: 24px;
    }

    .hero-icon {
        width: 40px;
        height: 24px;
    }

    .facet-badge-wrapper {
        width: 18px;
        height: 18px;
        bottom: -4px;
        right: -6px;
    }

    .facet-badge-wrapper img {
        width: 12px;
        height: 12px;
    }

    .filter-row {
        flex-direction: column;
        gap: 8px;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .filter-tags {
        flex-direction: column;
        align-items: flex-start;
    }

    .tag {
        align-self: flex-start;
    }
}