/* CSS FOR STAT PAGE */

.stat-header {
    margin: 0 20px;
    padding: 5px 15px;
}

.label-input-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-cards {
    margin: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 480px);
    gap: 20px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-width: 480px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
}

.stat-card-title {
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.divider {
    height: 1px;
    background: var(--border);
}

#streak-count {
    font-weight: bold;
}

.calendar {
    display: flex;
    align-self: center;
    flex-direction: column;
    gap: 10px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 1.2em;
    gap: 8px;
}

.btn-ghost {
    background: transparent;
    border: none;
    padding: 6px 8px;
    color: var(--fg);
}

.btn-ghost:hover {
    background-color: var(--border);
}

.calendar-dow, .calendar-grid {
    display: grid;
    grid-template-columns:repeat(7, 45px);
    gap: 10px;
}

.calendar-dow div {
    text-align: center;
    font-size: 12px;
    color: #888;
}

.day {
    text-align: center;
    padding: 8px 0;
    border-radius: 6px;
}

.day.today {
    border: 2px solid var(--muted);
}

.day.active {
    background: #a78bfa60;
}


#today-learning {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.group {
    display: flex;
    flex-direction: column;
}

.group-title {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 5px;
}

.stat-row {
    display: flex;
    align-items: center;
}

.stat-row .label {
    width: 110px;
    color: var(--muted);
}

.bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bar-bg {
    flex: 1;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

.bar-fill {
    display: block;
    height: 100%;
    border-radius: 5px;
}

.bar-fill.c1 {
    background: #a78bfa;
}

.bar-fill.c2 {
    background: #8bc2fa;
}

.bar-zero {
    background: var(--border);
}

.value {
    width: 56px;
    text-align: right;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.heatmap-chunk {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    justify-content: center;
}

.heatmap-dow {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    justify-items: center;
    font-size: 10px;
    color: var(--muted);
    gap: 2px;
}

.heatmap-months {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: 1fr;
    justify-items: center;
    gap: 2px;
    margin-bottom: 5px;
    color: var(--muted);
}

.heatmap-grid {
    display: grid;
    grid-template-rows: repeat(7, 1fr);
    grid-auto-flow: column;
    gap: 2px;
}

.heatmap-legend {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 5px;
}

.heatmap-legend .heatmap-cell {
    border-radius: 999px;
    width: 10px;
    height: 10px;
}

.heatmap-color-0 { background-color: var(--border); }
.heatmap-color-1 { background-color: #484462; }
.heatmap-color-2 { background-color: #665a92; }
.heatmap-color-3 { background-color: #8571c5; }
.heatmap-color-4 { background-color: #a689fa; }

.heatmap-cell {
    width: 14px;
    height: 14px;
    border-radius: 2px;
}

.heatmap-cell.muted {
    opacity: 0;
}

.period-tabs {
    display: flex;
    gap: 5px;
    justify-content: space-between;
}

.period-tabs .btn-ghost {
    flex: 1;
    font-size: 1em;
    padding: 4px 0;
    color: var(--muted);
}

.period-tabs .btn-ghost.active {
    background-color: var(--border);
    color: var(--fg);
    font-weight: bold;
}

.stat-block {
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.stat-title {
    font-weight: bold;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.chart-container {
    height: 100%;
}

.detail-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px 10px;
}

.detail-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
}

.inc-btn {
    margin-left: 6px;
    aspect-ratio: 1;
    padding: 2px 7px;
    border: none;
    border-radius: 50%;
}
.inc-btn:hover {
    font-weight: bold;
    background-color: var(--border);
}

.increment-menu {
    position: absolute;
    z-index: 1000;
    display: none;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.inc-menu-title {
    font-weight: bold;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.increment-menu .input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inc-input {
    appearance: textfield;
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}

.inc-input::-webkit-outer-spin-button,
.inc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Center the whole stats grid with side padding and responsive fill */
#statsSection .stat-cards{
  /* center the grid block */
  margin: 0 auto;

  /* nice gutter so cards don’t kiss the edges */
  padding: 0 16px;

  /* make it expand and wrap while staying centered */
  display: grid;
  gap: 20px;

  /* auto-fit lets the last card stretch to fill the row */
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));

  /* optional: keep a comfy max width; tweak as you like */

  /* keep columns centered when there’s extra space */
  justify-items: stretch;
  justify-content: center;
}

/* allow the grid to control width; the old min-width forced left alignment */
#statsSection .stat-card{
  min-width: 0;
}





