/* Dashboard Grid Layout */
.dashboard {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 10px;
    padding: 20px;
    background-color: var(--bg-color);
    flex: 1;
    min-height: 0;
}

/* Grid placement classes */
.span-2-cols {
    grid-column: span 2;
}

.span-2-rows {
    grid-row: span 2;
}

/* Stat Cards */
.stat-card {
    background-color: var(--panel-bg);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    overflow: visible;
}

.stat-card:not(#stat-alerts) {
    overflow-y: auto;
}

.stat-card h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

.help-icon {
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: help;
}

.help-icon:hover {
    color: var(--accent-color);
}

/* Global Tooltip */
.global-tooltip {
    position: fixed;
    background: var(--tooltip-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: normal;
    white-space: normal;
    width: 250px;
    max-width: 90vw;
    line-height: 1.4;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.global-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

.stat-card p {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Stat Breakdown */
.stat-breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.stat-breakdown-row .stat-breakdown {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.stat-breakdown {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
}

.stat-breakdown.align-right {
    text-align: right;
}

.stat-breakdown label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stat-breakdown span {
    color: var(--text-muted);
}

.stat-breakdown strong {
    color: var(--text-color);
}

/* Chart Cards */
.chart-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Position evolution card at bottom-left */
#stat-evolution {
    grid-column: 1 / 2;
    grid-row: 4;
}

/* Position special pokemon card next to evolution */
#stat-special {
    grid-column: 2 / 3;
    grid-row: 4;
}

/* These cards have stat-breakdown directly inside, remove extra spacing */
#stat-evolution .stat-breakdown,
#stat-special .stat-breakdown {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.chart-header h3 {
    margin-bottom: 0;
}

/* Chart View Toggle */
.chart-view-toggle.active .toggle-slider {
    left: calc(50% - 0.2rem);
    border-radius: 0.5rem 1rem 1rem 0.5rem;
}

/* When active: first icon muted, last icon highlighted */
.chart-view-toggle.active > :first-child {
    color: var(--text-muted);
}

.chart-view-toggle.active > :last-child {
    color: var(--text-color);
}

.chart-container {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-card canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Chart Stats (shared style for all chart stat sections) */
.chart-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
}

.chart-stats span {
    color: var(--text-muted);
}

.chart-stats strong {
    color: var(--text-color);
}

/* Alert List */
#alert-list {
    list-style: none;
    font-size: 0.8rem;
}

#alert-list li {
    color: var(--warning-color);
    margin-bottom: 4px;
}

/* Main content area */
.main-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
