/* ===== Habit Tracker Gizmo ===== */

.habits-full { max-width: 800px; margin: 0 auto; }
.habits-full h2 { margin-bottom: 1.25rem; }

/* === Stats === */
.habits-full__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.habits-full__stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}
.habits-full__stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
}
.habits-full__stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* === Add Habit === */
.habits-full__add {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.habits-full__add-input {
    flex: 1;
    min-width: 180px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-secondary);
}
.habits-full__add-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.habits-full__add-cat {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-secondary);
}
.habits-full__add-color {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
    cursor: pointer;
    background: var(--bg-secondary);
}
.habits-full__add-btn {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 8px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}
.habits-full__add-btn:hover { background: var(--accent-secondary); transform: translateY(-1px); }
.habits-full__add-btn:active { transform: translateY(0); }

/* === Toolbar === */
.habits-full__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}
.habits-full__filters { display: flex; gap: 0.25rem; }
.habits-full__filter {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.habits-full__filter:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.habits-full__filter--active { background: var(--accent-primary); color: #fff; border-color: var(--accent-primary); }
.habits-full__cat-filter {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* === Habit List === */
.habits-full__list { min-height: 50px; }
.habits-full__list-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}
.habits-full__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: var(--bg-secondary);
    transition: border-color 0.2s;
}
.habits-full__item:hover { border-color: var(--accent-primary); }
.habits-full__item--archived { opacity: 0.5; }
.habits-full__item-check {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--bg-card);
    transition: all 0.2s;
    font-size: 0.75rem;
}
.habits-full__item-check--done {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.habits-full__item-color {
    width: 6px;
    height: 32px;
    border-radius: 3px;
    min-width: 6px;
}
.habits-full__item-info { flex: 1; min-width: 0; }
.habits-full__item-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.habits-full__item-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}
.habits-full__item-streak {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--warning);
    white-space: nowrap;
    text-align: center;
    min-width: 50px;
}
.habits-full__item-actions { display: flex; gap: 0.25rem; }
.habits-full__item-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}
.habits-full__item-btn:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.habits-full__item-btn--danger:hover { border-color: var(--danger); color: var(--danger); }

/* === Sections === */
.habits-full__section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.habits-full__section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* === Heatmap === */
.habits-full__heatmap-wrap { overflow-x: auto; }
.habits-full__heatmap {
    display: grid;
    grid-template-rows: repeat(7, 14px);
    grid-auto-flow: column;
    grid-auto-columns: 14px;
    gap: 3px;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
}
.habits-full__heatmap-cell {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    position: relative;
}
.habits-full__heatmap-cell[title] { cursor: help; }
.habits-full__heatmap-cell--0 { background: var(--bg-secondary); }
.habits-full__heatmap-cell--1 { background: rgba(34, 197, 94, 0.25); border-color: rgba(34, 197, 94, 0.3); }
.habits-full__heatmap-cell--2 { background: rgba(34, 197, 94, 0.45); border-color: rgba(34, 197, 94, 0.5); }
.habits-full__heatmap-cell--3 { background: rgba(34, 197, 94, 0.65); border-color: rgba(34, 197, 94, 0.7); }
.habits-full__heatmap-cell--4 { background: rgba(34, 197, 94, 0.9); border-color: rgba(34, 197, 94, 0.95); }
.habits-full__heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    font-size: 0.6875rem;
    color: var(--text-secondary);
}
.habits-full__heatmap-legend .habits-full__heatmap-cell {
    width: 12px;
    height: 12px;
}

/* === Weekly Summary === */
.habits-full__weekly {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}
.habits-full__weekly-day {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem;
    text-align: center;
}
.habits-full__weekly-day--today { border-color: var(--accent-primary); }
.habits-full__weekly-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.habits-full__weekly-val {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

/* === Responsive === */
@media (max-width: 575px) {
    .habits-full__add { flex-direction: column; }
    .habits-full__add-color { width: 100%; height: 36px; }
    .habits-full__toolbar { flex-direction: column; align-items: stretch; }
    .habits-full__item { flex-wrap: wrap; }
    .habits-full__item-actions { width: 100%; justify-content: flex-end; margin-top: 0.25rem; }
}
