/* —— Check-in de humor (Divertidamente) —— */

.mood-root {
    z-index: 260;
}

.mood-root .mood-checkin-dialog.mood-modal {
    overflow: hidden;
}

.mood-checkin-dialog.modal {
    max-width: 520px;
    width: min(100%, 520px);
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    max-height: min(92vh, 720px);
    color: #f0f6ff;
}

.mood-checkin-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 720px);
    background: linear-gradient(165deg, #0b1a3a 0%, #102a5c 45%, #0d2248 100%);
    border-radius: calc(var(--radius) + 6px);
    padding: 1.5rem 1.35rem 1.25rem;
    color: #f0f6ff;
    box-shadow:
        0 28px 80px rgba(0, 20, 60, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    overflow: hidden;
}

.mood-aurora {
    position: absolute;
    inset: -40% -20% auto;
    height: 70%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(255, 217, 61, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse at 80% 20%, rgba(155, 89, 182, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(56, 182, 255, 0.15) 0%, transparent 55%);
    pointer-events: none;
    animation: mood-aurora-shift 12s ease-in-out infinite alternate;
}

@keyframes mood-aurora-shift {
    0% { transform: translateX(-3%) rotate(-2deg); opacity: 0.85; }
    100% { transform: translateX(3%) rotate(2deg); opacity: 1; }
}

.mood-checkin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    z-index: 1;
    margin-bottom: 1.1rem;
    flex-shrink: 0;
}

.mood-checkin-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.45rem;
}

.mood-checkin-header h3 {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    margin: 0;
}

.mood-checkin-sub {
    margin: 0.4rem 0 0;
    font-size: 0.92rem;
    color: rgba(230, 240, 255, 0.72);
    line-height: 1.45;
}

.mood-close {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
}

.mood-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.mood-progress {
    position: relative;
    z-index: 1;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.mood-progress-track {
    height: 5px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.mood-progress-fill {
    height: 100%;
    width: 33%;
    border-radius: 99px;
    background: linear-gradient(90deg, #ffd93d, #38b6ff);
    transition: width 0.45s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.mood-progress-label {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
}

.mood-step {
    position: relative;
    z-index: 1;
    animation: mood-step-in 0.4s ease;
    min-height: 0;
}

.mood-step[hidden] {
    display: none !important;
}

.mood-step[data-step="area"]:not([hidden]),
.mood-step[data-step="detail"]:not([hidden]) {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes mood-step-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mood-emotion-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 0.15rem;
}

@media (min-width: 420px) {
    .mood-emotion-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 480px) {
    .mood-emotion-grid {
        grid-template-columns: repeat(5, 1fr);
        max-height: none;
        overflow: visible;
    }
}

.mood-emotion-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 0.35rem 0.7rem;
    border: 2px solid transparent;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    color: #fff;
    font-family: var(--font);
    min-height: 104px;
}

.mood-emotion-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.mood-emotion-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.mood-emotion-btn.is-selected {
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.mood-emotion-orb {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(255, 255, 255, 0.15) inset;
    transition: transform 0.3s ease;
}

.mood-emotion-btn:hover .mood-emotion-orb {
    transform: scale(1.05);
}

.mood-emotion-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.15;
}

.mood-emo--joy .mood-emotion-orb { background: linear-gradient(145deg, #ffe566, #ffd93d); }
.mood-emo--sadness .mood-emotion-orb { background: linear-gradient(145deg, #6eb5ff, #4a90d9); }
.mood-emo--anger .mood-emotion-orb { background: linear-gradient(145deg, #ff7b6b, #e74c3c); }
.mood-emo--fear .mood-emotion-orb { background: linear-gradient(145deg, #c39bd3, #9b59b6); }
.mood-emo--disgust .mood-emotion-orb { background: linear-gradient(145deg, #58d68d, #2ecc71); }
.mood-emo--anxiety .mood-emotion-orb { background: linear-gradient(145deg, #ffb86a, #ff9f43); }
.mood-emo--calm .mood-emotion-orb { background: linear-gradient(145deg, #7ee8d6, #48c9b0); }
.mood-emo--tired .mood-emotion-orb { background: linear-gradient(145deg, #b8c5d6, #8a9bb0); }
.mood-emo--grateful .mood-emotion-orb { background: linear-gradient(145deg, #ffb3c6, #ff8fab); }
.mood-emo--lonely .mood-emotion-orb { background: linear-gradient(145deg, #b8a9d4, #8e7cc3); }
.mood-emo--confident .mood-emotion-orb { background: linear-gradient(145deg, #5fc4ff, #1a7ae0); }

.mood-chip-grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(42vh, 320px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 2px 0.15rem 2px 0;
}

.mood-chip-grid--detail {
    max-height: min(38vh, 280px);
}

.mood-chip {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    color: #f4f8ff;
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mood-chip i {
    width: 1.25rem;
    text-align: center;
    opacity: 0.85;
    flex-shrink: 0;
}

.mood-chip:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.45);
}

.mood-chip--muted {
    opacity: 0.75;
    font-weight: 500;
}

.mood-chip--accent {
    border-color: rgba(255, 217, 61, 0.35);
    background: rgba(255, 217, 61, 0.1);
}

.mood-checkin-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.15rem;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.mood-skip-btn,
.mood-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.15rem;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.mood-skip-btn:hover,
.mood-back-btn:hover {
    color: rgba(255, 255, 255, 0.95);
}

.mood-step--done {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
}

.mood-done-card h4 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0.75rem 0 0.35rem;
}

.mood-done-card p {
    font-size: 0.9rem;
    color: rgba(230, 240, 255, 0.75);
    line-height: 1.5;
    margin: 0 0 1.1rem;
}

.mood-done-orb {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border-radius: 50%;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    animation: mood-done-pulse 2s ease-in-out infinite;
}

@keyframes mood-done-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.mood-btn-glow {
    box-shadow: 0 8px 28px rgba(56, 182, 255, 0.35);
}

.mood-history-dialog.modal {
    display: flex;
    flex-direction: column;
    max-height: min(90vh, 780px);
    overflow: hidden;
}

.mood-history-dialog .modal-header,
.mood-history-dialog .modal-footer {
    flex-shrink: 0;
}

.mood-history-dialog .modal-header {
    border-bottom-color: var(--line);
}

.mood-title-icon {
    color: var(--blue-500);
    margin-right: 0.35rem;
}

.mood-history-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mood-period-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(160deg, #f4faff 0%, #fff 100%);
    border: 1px solid var(--line);
}

.mood-period-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.mood-period-btn {
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink-soft);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mood-period-btn:hover {
    border-color: var(--blue-400);
    color: var(--blue-800);
}

.mood-period-btn.is-active {
    background: linear-gradient(135deg, var(--blue-800), var(--blue-600));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(0, 74, 173, 0.22);
}

.mood-period-custom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.mood-period-input {
    min-height: 2.2rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: var(--font);
    font-size: 0.85rem;
    color: var(--ink);
    background: #fff;
}

.mood-period-sep {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.mood-period-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.mood-period-label {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
}

.mood-history-footer {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.mood-history-dialog .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 560px) {
    .mood-period-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .mood-period-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

.mood-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 520px) {
    .mood-stats-row {
        grid-template-columns: 1fr 1fr;
    }
    .mood-stat-card--dominant {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: center;
    }
}

.mood-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 1rem 0.65rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(160deg, var(--blue-50) 0%, #fff 100%);
    border: 1px solid var(--line);
    text-align: center;
}

.mood-stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--blue-800);
    line-height: 1;
}

.mood-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mood-stat-orb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(0, 42, 102, 0.15);
}

.mood-today-banner[hidden] {
    display: none !important;
}

.mood-today-banner:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border: 1px solid #ffe08a;
}

.mood-today-banner-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #7a5c00;
}

.mood-chart-wrap {
    padding: 1rem 0.5rem 0.25rem;
    border-radius: var(--radius-sm);
    background: var(--blue-50);
    border: 1px solid var(--line);
}

.mood-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    justify-content: center;
    margin-bottom: 0.85rem;
}

.mood-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ink-soft);
}

.mood-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.mood-chart {
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 3px;
    min-height: 140px;
    padding: 0 0.25rem 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.mood-chart-col {
    flex: 1;
    min-width: 22px;
    max-width: 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.mood-chart-bar-wrap {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.mood-chart-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 42, 102, 0.18);
    transition: transform 0.2s ease;
    cursor: default;
    position: relative;
}

.mood-chart-dot:hover {
    transform: scale(1.15);
    z-index: 2;
}

.mood-chart-dot.is-empty {
    width: 8px;
    height: 8px;
    background: var(--line) !important;
    box-shadow: none;
    opacity: 0.6;
}

.mood-chart-dot.is-today {
    box-shadow: 0 0 0 3px rgba(56, 182, 255, 0.45), 0 4px 12px rgba(0, 42, 102, 0.2);
}

.mood-chart-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--ink-soft);
    white-space: nowrap;
}

.mood-chart-col.is-weekend .mood-chart-label {
    opacity: 0.55;
}

.mood-recent h4 {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 0.65rem;
}

.mood-recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mood-recent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
}

.mood-recent-orb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0, 42, 102, 0.12);
}

.mood-recent-meta {
    flex: 1;
    min-width: 0;
}

.mood-recent-meta strong {
    display: block;
    font-size: 0.88rem;
    color: var(--ink);
}

.mood-recent-meta span {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mood-recent-date {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--ink-soft);
    flex-shrink: 0;
}

.mood-bg--joy { background: linear-gradient(145deg, #ffe566, #ffd93d); }
.mood-bg--sadness { background: linear-gradient(145deg, #6eb5ff, #4a90d9); }
.mood-bg--anger { background: linear-gradient(145deg, #ff7b6b, #e74c3c); }
.mood-bg--fear { background: linear-gradient(145deg, #c39bd3, #9b59b6); }
.mood-bg--disgust { background: linear-gradient(145deg, #58d68d, #2ecc71); }
.mood-bg--anxiety { background: linear-gradient(145deg, #ffb86a, #ff9f43); }
.mood-bg--calm { background: linear-gradient(145deg, #7ee8d6, #48c9b0); }
.mood-bg--tired { background: linear-gradient(145deg, #b8c5d6, #8a9bb0); }
.mood-bg--grateful { background: linear-gradient(145deg, #ffb3c6, #ff8fab); }
.mood-bg--lonely { background: linear-gradient(145deg, #b8a9d4, #8e7cc3); }
.mood-bg--confident { background: linear-gradient(145deg, #5fc4ff, #1a7ae0); }

.mood-backdrop {
    backdrop-filter: blur(6px);
}
