/* =========================================
   STATS PAGE
   ========================================= */

.stats-page {
    background: #000;
    color: #fff;

    width: min(1200px, 94%);
    margin: 0 auto;

    padding: 40px 50px 80px;

    box-sizing: border-box;
}


/* =========================================
   INTRODUCTION
   ========================================= */

.stats-intro {
    width: 100%;
    box-sizing: border-box;

    padding: 10px 20px 30px;

    text-align: center;
}

.stats-intro h1 {
    margin-top: 0;
    margin-bottom: 20px;
}

.stats-intro p {
    max-width: 850px;
    margin: 10px auto;

    line-height: 1.6;
}


/* =========================================
   GENERAL MODULE
   ========================================= */

.stats-module {
    background: #111;

    border: 1px solid #333;
    border-radius: 6px;

    padding: 10px;

    box-sizing: border-box;
}

.stats-module h2 {
    margin-top: 0;
    margin-bottom: 10px;

    text-align: center;
}


/* =========================================
   TOP STATISTICS ROW
   ========================================= */

.stats-row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;

    width: 100%;
}


/* =========================================
   OVERALL GAMES
   ========================================= */

.overall-games {
    display: flex;

    justify-content: space-between;
    align-items: center;

    padding: 5px;

    margin-bottom: 10px;
	margin-left: 30px;
	margin-right: 30px;

    background: #000;

    border-radius: 4px;
}

.stat-label {
    font-size: 16px;
}

.stat-value {
    font-size: 24px;
    font-weight: 600;
	padding: 4px;
}


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

.stats-table {
    width: 100%;

    border-collapse: collapse;

    text-align: center;
}

.stats-table th,
.stats-table td {
    padding: 5px;

    border-bottom: 1px solid #333;
}

.stats-table th {
    font-weight: 600;
}


/* =========================================
   TURN CHART
   ========================================= */

.turn-chart-container {
    position: relative;

    height: 250px;

    width: 100%;

    background: #000;

    border-radius: 4px;

    padding: 10px;

    box-sizing: border-box;
}


/* =========================================
   FILTERS
   ========================================= */

.filters-module {
    margin-top: 10px;
}

.filters-module h2 {
    margin-bottom: 10px;
}

.filters-layout {
    display: grid;

    grid-template-columns: 1fr 1fr 2fr;
	margin-top: 10px;
    gap: 25px;

    align-items: start;
}


/* =========================================
   FILTER HEADINGS
   ========================================= */

.player-filter h3,
.game-filters h3,
.commander-filters > h3 {
    margin-top: 0;
    margin-bottom: 15px;

    text-align: center;
}


/* =========================================
   PLAYER
   ========================================= */

.player-filter {
    width: 100%;
}

.player-filter select {
    width: 100%;

    box-sizing: border-box;

    padding: 10px;

    border-radius: 4px;
	margin-top:25px;
    border: 1px solid #555;

    background: #222;
    color: #fff;
}


/* =========================================
   GAME FILTERS
   ========================================= */

.date-filters {
    display: flex;

    flex-direction: column;

    gap: 15px;
}


/* =========================================
   GENERAL FILTER CONTROLS
   ========================================= */

.filter-control {
    display: flex;

    flex-direction: column;

    gap: 7px;
}

.filter-control label {
    font-weight: 500;

    text-align: center;
}

.filter-control select,
.filter-control input {
    width: 100%;

    box-sizing: border-box;

    padding: 10px;

    border-radius: 4px;

    border: 1px solid #555;

    background: #222;
    color: #fff;
}


/* =========================================
   COMMANDER / SPECIAL
   ========================================= */

.commander-special {
    display: grid;

    grid-template-columns: 1.5fr 1fr;

    gap: 15px;
}


/* =========================================
   COLOR IDENTITY
   ========================================= */

.color-filter {
    margin-top: 15px;
}

.color-filter h4 {
    margin-top: 0;
    margin-bottom: 15px;
	font-weight: 500;
    text-align: center;
}

.color-options {
    display: flex;

    justify-content: center;

    gap: 20px;
}

.color-option {
    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 8px;

    cursor: pointer;
}

.mana-symbol {
    width: 35px;
    height: 35px;

    object-fit: contain;
}

.colorless-symbol {
    background: #aaa;

    border-radius: 50%;

    display: flex;

    align-items: center;
    justify-content: center;

    font-weight: bold;

    color: #000;
}


/* =========================================
   APPLY BUTTON
   ========================================= */

.filter-actions {
    display: flex;

    justify-content: center;

    margin-top: 10px;
}

.apply-filter-button {
    padding: 12px 35px;

    border: none;
    border-radius: 4px;

    background: #666;
    color: #fff;

    font-size: 16px;
    font-weight: 600;

    cursor: pointer;
}

.apply-filter-button:disabled {
    background: #333;

    color: #666;

    cursor: default;
}


/* =========================================
   FILTERED STATISTICS HEADER
   ========================================= */

.filtered-header {
    margin-top: 45px;

    margin-bottom: 20px;

    text-align: center;
}

.filtered-header h2 {
    margin: 0;
}


/* =========================================
   FILTERED WINRATE
   ========================================= */

.filtered-winrate-module {
    width: 100%;
}

/* =========================================
   DASHBOARD MODE
   ========================================= */

.dashboard-mode {
    margin-top: 20px;

    text-align: center;
}

.dashboard-mode h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.dashboard-mode-slider {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 15px;
}


/* =========================================
   DASHBOARD MODE SWITCH
   ========================================= */

.switch {
    position: relative;

    display: inline-block;

    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;

    cursor: pointer;

    top: 0;
    left: 0;
    right: 0;
    bottom: 0;

    background: #333;

    border: 1px solid #555;

    border-radius: 28px;

    transition: 0.2s;
}

.slider:before {
    position: absolute;

    content: "";

    height: 20px;
    width: 20px;

    left: 3px;
    bottom: 3px;

    background: #fff;

    border-radius: 50%;

    transition: 0.2s;
}

.switch input:checked + .slider {
    background: #666;
}

.switch input:checked + .slider:before {
    transform: translateX(24px);
}

.dashboard-mode-label {
    font-size: 15px;

    min-width: 110px;
}

.dashboard-mode-label:first-child {
    text-align: right;
}

.dashboard-mode-label:last-child {
    text-align: left;
}


/* =========================================
   DASHBOARD BREAKDOWN
   ========================================= */

.dashboard-breakdown-module {
    margin-top: 10px;

    width: 100%;
}

.dashboard-breakdown-container {
    width: 100%;

    overflow-x: auto;
}

.dashboard-breakdown-module .stats-table {
    width: 100%;
}

.dashboard-breakdown-module .stats-table th,
.dashboard-breakdown-module .stats-table td {
    padding: 7px;
}


/* =========================================
   EMPTY BREAKDOWN
   ========================================= */

.dashboard-breakdown-empty {
    text-align: center;

    color: #888;

    padding: 15px !important;
}

/* =========================================
   DASHBOARD BREAKDOWN SORTING
   ========================================= */

.sortable-header {
    cursor: pointer;

    user-select: none;

    transition: background 0.15s;
}

.sortable-header:hover {
    background: #222;
}

.sort-indicator {
    font-size: 11px;

    margin-left: 3px;

    display: inline-block;

    width: 12px;
}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 768px) {

    .stats-page {
        width: 100%;

        padding: 25px 15px 60px;
    }


    .stats-row {
        grid-template-columns: 1fr;
    }



    .filters-layout {
        grid-template-columns: 1fr;

        gap: 30px;
    }

    .commander-special {
        grid-template-columns: 1.5fr 1fr;
    }

    .color-options {
        gap: 18px;

        flex-wrap: wrap;
    }

}