/**
 * Activity Widgets - ULTRA COMPACT PREMIUM (Version Final)
 * Heatmap lineal, Record sutil, SVG profesionales
 */

/* ==============================================
   BASE WIDGET
============================================== */
.activity-widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    transition: all 0.2s ease;
}

.activity-widget:hover {
    border-color: var(--accent-color);
    box-shadow: 0 1px 6px rgba(74, 144, 164, 0.08);
}

/* ==============================================
   MOMENTUM WIDGET
============================================== */
.momentum-widget-rich {
    padding: 10px;
}

.momentum-current {
    margin-bottom: 8px;
}

.streak-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.streak-main {
    display: flex;
    align-items: baseline;
    gap: 4px;
    justify-content: center;
    padding: 0;
}

.streak-number-big {
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.streak-number-big[data-streak="0"] {
    opacity: 0.25;
}

.streak-number-big[data-streak]:not([data-streak="0"])::after {
    content: ' 🔥';
    font-size: 18px;
    -webkit-text-fill-color: initial;
}

.streak-days-label {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* Milestone */
.momentum-milestone {
    margin-bottom: 8px;
    padding: 7px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.milestone-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.milestone-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 3px rgba(74, 144, 164, 0.3);
}

body.dark-mode .milestone-progress-fill {
    box-shadow: 0 0 5px rgba(74, 144, 164, 0.5);
}

.milestone-text {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    text-align: right;
    margin-bottom: 2px;
    line-height: 1;
}

.milestone-current {
    font-weight: 800;
    color: var(--accent-color);
}

.milestone-message {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
    line-height: 1.1;
}

/* Heatmap - 2 FILAS DE 15 DÍAS */
.momentum-heatmap {
    margin-bottom: 8px;
}

.heatmap-title {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.heatmap-grid-dual {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 1px;
    margin-bottom: 4px;
    padding: 2px 0;
}

.heatmap-day {
    width: 100%;
    height: 18px;
    border-radius: 2px;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    transition: all 0.12s ease;
    cursor: pointer;
    position: relative;
}

.heatmap-day.active {
    background: var(--accent-color);
}


.heatmap-day:hover {
    transform: scale(1.15);
    z-index: 2;
    background: var(--accent-hover);
    cursor: pointer;
}

.heatmap-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.6rem;
    color: var(--text-secondary);
    padding-top: 4px;
    border-top: 1px solid var(--border-color);
    line-height: 1;
}

.heatmap-count strong {
    font-weight: 800;
    color: var(--accent-color);
}

.heatmap-percentage {
    color: var(--text-tertiary);
    font-weight: 700;
}

/* Mood Evolution Chart - ALINEADO CON HEATMAP */
.momentum-mood-evolution {
    margin-bottom: 8px;
}

.mood-evo-title {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mood-evolution {
    padding: 4px 0 0;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.mood-evo-chart {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 1px;
    height: 24px;
    padding: 0;
}

.mood-bar {
    width: 100%;
    border-radius: 2px 2px 0 0;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    min-height: 3px;
    align-self: end;
}

.mood-bar.empty {
    background: var(--bg-tertiary);
    opacity: 0.3;
}

.mood-bar:hover {
    opacity: 0.9;
    /* transform: scaleY(1.05); */
}

.mood-bar.today {
    /*border: 2px solid var(--accent-color);
    border-bottom: none; */
}

/* Record - SUTIL E INTEGRADO */
.momentum-record {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.record-icon {
    font-size: 16px;
    opacity: 0.7;
    line-height: 1;
}

.record-content {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
}

.record-label {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.record-value {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-primary);
}

.record-days {
    font-size: 0.75rem;
    color: var(--accent-color);
}

.record-period {
    font-size: 0.55rem;
    color: var(--text-tertiary);
    font-weight: 500;
    flex-basis: 100%;
}

.momentum-record.no-record {
    opacity: 0.5;
}

.momentum-record.no-record .record-icon {
    opacity: 0.4;
}

/* ==============================================
   TODAY WIDGET - SVG PROFESIONAL
============================================== */
.today-widget-rich {
    padding: 10px;
}

.today-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.today-icon {
    width: 13px;
    height: 13px;
    color: var(--accent-color);
}

.today-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
}

.today-content {
    font-size: 0.7rem;
}

.today-empty {
    text-align: center;
    color: var(--text-tertiary);
    padding: 8px 0;
    font-size: 0.7rem;
}

/* Today Summary Grid */
.today-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 5px;
}

.today-stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px;
    background: var(--bg-secondary);
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

.today-stat-svg {
    width: 14px;
    height: 14px;
    color: var(--accent-color);
    flex-shrink: 0;
}

.today-stat-info {
    flex: 1;
    min-width: 0;
}

.today-stat-value {
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.today-stat-label {
    font-size: 0.55rem;
    color: var(--text-tertiary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
    margin-top: 1px;
}

.today-stat-secondary {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 4px;
    opacity: 0.8;
    line-height: 1.2;
}

/* Indicators - SVG con colores reales */
.today-indicators {
    display: flex;
    gap: 3px;
}

.today-indicator {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
}

.indicator-svg {
    width: 13px;
    height: 13px;
    color: var(--text-tertiary);
    stroke-width: 2;
    transition: all 0.2s ease;
}

.today-indicator.active {
    background: var(--bg-card);
    border-color: var(--accent-color);
}

.today-indicator.active .indicator-svg {
    color: var(--accent-color);
}

/* Mood/Status con colores personalizados (vienen inline) */
.today-indicator.mood-colored .indicator-svg,
.today-indicator.status-colored .indicator-svg {
    stroke-width: 2.5;
}

.today-indicator:hover {
    transform: scale(1.08);
}

body.dark-mode .today-indicator.active {
    background: var(--bg-secondary);
}

/* ==============================================
   ONBOARDING WIDGET
============================================== */
.onboarding-widget {
    padding: 10px;
}

.onboarding-widget .widget-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.widget-icon {
    width: 13px;
    height: 13px;
    color: var(--accent-color);
}

.widget-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-primary);
}

.widget-content {
    padding-top: 0;
}

.onboarding-progress {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 3px rgba(74, 144, 164, 0.3);
}

body.dark-mode .progress-fill {
    box-shadow: 0 0 5px rgba(74, 144, 164, 0.5);
}

.progress-text {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-align: center;
    font-weight: 600;
    line-height: 1;
}

.progress-value {
    font-weight: 800;
    color: var(--accent-color);
}

.onboarding-widget.completed {
    animation: fadeOut 2s ease forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; transform: scale(1.01); }
    100% { opacity: 0; transform: scale(0.97); }
}

/* Onboarding steps list */
.onboarding-steps {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.onboarding-step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: var(--text-secondary);
    padding: 3px 0;
}

.onboarding-step .step-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    font-size: 0;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
}

.onboarding-step.done {
    color: var(--text-primary);
    text-decoration: line-through;
    opacity: 0.6;
}

.onboarding-step.done .step-check {
    background: var(--accent-color);
    border-color: var(--accent-color);
    font-size: 0.6rem;
    color: #fff;
}

/* ==============================================
   ACCESSIBILITY
============================================== */
.activity-widget:focus-within {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

