/* Stats Tab Styles for _stats_tab.html */

/* Container for the entire Stats tab */
.stats-container {
    padding: 20px;
    background-color: #0b0b0b; /* Pitch black background */
    color: #ffffff;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

/* Individual composite element (Directional or Measured Stats) */
.stats-element {
    display: flex;
    flex-direction: column;
    background-color: #000; /* Dark grey for div background */
    border: 0px solid #333333;
    border-radius: 5px;
    margin-bottom: 10px;
    padding: 5px;
    width: 600px; /* Fixed width */
    height: 400px; /* Fixed height (4:3 ratio) */
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(220, 220, 220, 0.5)
}

/* Make timeline-stats and first-touch-stats full width */
.stats-element.timeline-stats,
.stats-element.first-touch-stats {
    width: 100%; /* Full width of stats-container */
    height: 400px; /* Keep height consistent */
}

/* Centered title */
.stats-title {
    width: 100%;
    text-align: center;
    font-size: 1em;
    color: rgb(225,150,140,1);
    font-weight: bold;
    margin-bottom: 20px; /* Increased to accommodate larger text below */
}

/* Content container (table, divider, chart) */
.stats-content {
    display: flex;
    flex: 1;
    align-items: center;
    width: 100%;
    overflow: hidden;
    background-color: #000000; /* Pitch black inner content */
}

/* Table section for metrics */
.stats-table {
    flex: 0 0 50%;
    padding: 0;
    margin: 0;
    text-align: center; /* Center all text */
}

.stats-table .stats-row {
    display: block;
    margin-bottom: 15px; /* Increased for larger text */
}

.stats-table .metric {
    font-weight: bold;
    font-size: 2em; /* Increased text size to fill the div */
    color: #ddd;
    display: block;
    margin-bottom: 8px; /* Increased for spacing */
}

.stats-table .value {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.stats-table .positive-value {
    color: rgb(37, 149, 169);
    font-size: 3em; /* Increased text size */
}

.stats-table .negative-value {
    color: rgb(165, 106, 130);
    font-size: 3em; /* Increased text size */
}

/* Vertical divider between table and chart */
.stats-divider {
    flex: 0 0 1px;
    background-color: #333333;
    height: 100%;
    margin: 0;
}

/* Chart section for donut chart */
.stats-chart {
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 300px;
    height: 300px;
}

.stats-chart canvas {
    width: 300px !important;
    height: 300px !important;
}

/* Responsive design for small screens */
@media (max-width: 768px) {
    .stats-element {
        flex-direction: column;
        width: 400px;
        height: 300px;
        overflow: visible;
    }

    .stats-element.timeline-stats,
    .stats-element.first-touch-stats {
        width: 100%; /* Full width on mobile */
        height: auto; /* Keep height consistent */
    }

    .stats-content {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-title {
        font-size: 1em;
        margin-bottom: 15px;
        background-color: #000;
    }

    .stats-divider {
        width: 100%;
        height: 1px;
        margin: 15px 0;
    }

    .stats-table, .stats-chart {
        flex: 1;
        width: 100%;
        padding: 10px 0;
    }

    .stats-table .metric,
    .stats-table .positive-value,
    .stats-table .negative-value {
        font-size: 2em; /* Slightly smaller on mobile to fit */
    }

    .stats-table .stats-row {
        margin-bottom: 20px;
        padding: 20px;
    }

    .stats-chart {
        width: 200px;
        height: 200px;
        margin: 0 auto;
    }

    .stats-chart canvas {
        width: 200px !important;
        height: 200px !important;
    }
}