/* ============================================
   Components – Wiederkehrende UI-Elemente
   ============================================ */

/* Streak Indicator */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--warning-bg);
    color: var(--warning);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Habit Icon Circle */
.icon-circle {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Stat Card */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
}
.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Avatar Selection Grid */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}
.avatar-option {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}
.avatar-option:hover { border-color: var(--accent-light); }
.avatar-option.selected { border-color: var(--primary); background: var(--primary-light); }

/* Color Picker */
.color-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.color-option {
    width: 32px; height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}
.color-option:hover { transform: scale(1.15); }
.color-option.selected { border-color: #fff; }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 16px;
}
.tab {
    flex: 1;
    padding: 8px 16px;
    text-align: center;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    background: none;
    transition: var(--transition);
}
.tab.active {
    background: var(--accent);
    color: #fff;
}
.tab:hover:not(.active) { color: var(--text-primary); }

/* Checkbox Toggle */
.toggle {
    position: relative;
    width: 44px; height: 24px;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}
.toggle.active { background: var(--success); }
.toggle::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: var(--transition);
}
.toggle.active::after { left: 22px; }

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-xs);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-circle { width: 44px; height: 44px; border-radius: 50%; }
.skeleton-card { height: 100px; border-radius: var(--radius); }
