﻿:root {
    --mood-accent: #ec4899;
    --mood-accent-soft: #fce7f3;
    --mood-gradient: linear-gradient(135deg, #db2777, #8b5cf6);
}

.mood-body { background: #fdf4ff; }

.mood-main { padding-bottom: calc(var(--mobile-nav-h, 64px) + 24px); }

.mood-workspace {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mood-view-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mood-view-tab {
    flex: 1;
    min-width: 90px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1.5px solid var(--glass-border, rgba(139, 92, 246, 0.15));
    background: var(--surface, #ffffff);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.mood-view-tab.active {
    background: var(--mood-gradient);
    color: white;
    border-color: transparent;
}

.mood-stats-ribbon {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: var(--surface, #ffffff);
    border: 1.5px solid var(--glass-border, rgba(139, 92, 246, 0.15));
    border-radius: 16px;
    padding: 12px;
}

.mood-stat { text-align: center; }

.mood-stat-val {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: #be185d;
}

.mood-stat-label {
    font-size: 0.68rem;
    color: var(--text-muted, #6b7280);
}

.mood-editor-card,
.mood-entries-card,
.mood-chart-card {
    background: var(--surface, #ffffff);
    border: 1.5px solid var(--glass-border, rgba(139, 92, 246, 0.15));
    border-radius: 18px;
    padding: 16px;
}

.mood-editor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mood-editor-head h3 { margin: 0; font-size: 1rem; }

.mood-btn-primary {
    padding: 8px 16px;
    border: none;
    border-radius: 12px;
    background: var(--mood-gradient);
    color: white;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}

.mood-slider-wrap label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.mood-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mood-slider-row input[type="range"] {
    flex: 1;
    accent-color: #db2777;
}

.mood-slider-row strong {
    min-width: 28px;
    text-align: center;
    color: #be185d;
}

.mood-feelings {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 14px 0;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.mood-feelings.is-empty {
    display: none;
    margin: 0;
}

.mood-feeling-chip {
    flex: 0 0 auto;
    min-width: 44px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1.5px solid #f3e8ff;
    background: #faf5ff;
    font-family: inherit;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    text-align: center;
}

.mood-feeling-chip.selected {
    border-color: #db2777;
    background: var(--mood-accent-soft);
    color: #9d174d;
}

.mood-time-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.mood-time-input {
    width: 100%;
    max-width: 160px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1.5px solid #e9d5ff;
    font-family: inherit;
}

.mood-entry-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed #f3e8ff;
}

.mood-entry-item:last-child { border-bottom: none; }

.mood-entry-meta strong { display: block; font-size: 0.88rem; }
.mood-entry-meta small { color: var(--text-muted); font-size: 0.72rem; }

.mood-entry-actions { display: flex; gap: 6px; }

.mood-entry-actions button {
    padding: 6px 12px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #fdf2f8, #f5f3ff);
    color: #9d174d;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 3px rgba(219, 39, 119, 0.12);
}

.mood-entry-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(219, 39, 119, 0.18);
}

.mood-entry-actions button[data-del] {
    background: linear-gradient(135deg, #fff1f2, #ffe4e6);
    color: #be123c;
}

.mood-entry-note-btn {
    background: linear-gradient(135deg, #ede9fe, #f5f3ff) !important;
    color: #6d28d9 !important;
}

/* ناوبری تاریخ */
.map-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.92);
    border: 1.5px solid rgba(219, 39, 119, 0.12);
    border-radius: 16px;
    margin-bottom: 4px;
}

.map-nav-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: linear-gradient(135deg, #fdf2f8, #f5f3ff);
    color: #9d174d;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(219, 39, 119, 0.1);
}

.map-nav-btn:hover {
    background: linear-gradient(135deg, #fce7f3, #ede9fe);
    transform: scale(1.05);
}

.map-date-chip {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface, #ffffff);
    border: 1px solid #f3e8ff;
    border-radius: 14px;
    padding: 8px 12px;
    min-width: 0;
}

.map-date-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.map-date-text strong {
    font-size: 0.9rem;
    font-weight: 700;
    color: #831843;
}

.map-date-text small {
    font-size: 0.72rem;
    color: var(--text-muted, #6b7280);
}

.map-today-btn {
    border: none;
    background: linear-gradient(135deg, #db2777, #8b5cf6);
    color: white;
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(219, 39, 119, 0.28);
    flex-shrink: 0;
    transition: transform 0.15s;
}

.map-today-btn:hover {
    transform: translateY(-1px);
}

.desktop-only-inline { display: inline-flex; }

@media (max-width: 768px) {
    .desktop-only-inline { display: none; }
}

/* مودال یادداشت */
.mood-note-head .pers-icon-btn,
.mood-note-head button[data-close-note] {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    background: #fdf2f8;
    color: #9d174d;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s;
}

.mood-note-head .pers-icon-btn:hover {
    background: #fce7f3;
}

.mood-note-actions .pers-btn,
.mood-note-actions button {
    flex: 1;
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.mood-note-actions .pers-btn-primary,
.mood-note-actions #mood-note-save {
    background: linear-gradient(135deg, #db2777, #8b5cf6);
    color: white;
    box-shadow: 0 4px 14px rgba(219, 39, 119, 0.3);
}

.mood-note-actions .pers-btn-primary:hover,
.mood-note-actions #mood-note-save:hover {
    transform: translateY(-1px);
}

.mood-note-actions .pers-btn-ghost,
.mood-note-actions [data-close-note]:not(.pers-icon-btn) {
    background: #f5f3ff;
    color: #6d28d9;
}

.mood-note-text:focus {
    outline: none;
    border-color: #db2777;
    box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.12);
}

.mood-chart {
    position: relative;
    min-height: 180px;
    padding: 8px 0 4px;
}

.mood-line-chart {
    width: 100%;
    height: auto;
    display: block;
}

.mood-line-chart .mood-zero-line {
    stroke: #ddd6fe;
    stroke-width: 1.5;
    stroke-dasharray: 5 4;
}

.mood-line-chart .mood-line-poly {
    fill: none;
    stroke-width: 3.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.mood-line-chart .mood-line-dot {
    fill: #db2777;
    stroke: #fff;
    stroke-width: 2;
}

.mood-line-chart .mood-line-dot-bg {
    fill: #fff;
    stroke: #f9a8d4;
    stroke-width: 1.5;
    filter: drop-shadow(0 1px 2px rgba(219, 39, 119, 0.18));
}

.mood-line-chart .mood-line-emoji {
    font-size: 16px;
    pointer-events: none;
    user-select: none;
}

.mood-line-chart.has-emoji-dots .mood-line-poly {
    stroke-width: 2.5;
}

.mood-line-chart .mood-axis-label {
    font-size: 9px;
    fill: #9ca3af;
    font-family: Vazirmatn, sans-serif;
}

.mood-line-chart .mood-y-label {
    font-size: 8px;
    fill: #c4b5fd;
    font-family: Vazirmatn, sans-serif;
}

.mood-analysis {
    font-size: 0.8rem;
    color: #6b21a8;
    margin-bottom: 10px;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.month-cell {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 1px solid #f3e8ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    background: #fafafa;
}

.month-cell.has-mood {
    background: var(--mood-accent-soft);
    border-color: #f9a8d4;
    font-weight: 700;
    color: #9d174d;
}

.month-cell.is-today {
    outline: 2px solid #db2777;
}

.mood-toast {
    position: fixed;
    bottom: calc(var(--mobile-nav-h, 64px) + 16px);
    left: 50%;
    transform: translateX(-50%);
    background: #9d174d;
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 200;
}

.mood-toast.hidden { display: none; }

.mood-note-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mood-note-modal.hidden { display: none !important; }

.mood-note-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.mood-note-card {
    position: relative;
    width: min(100%, 400px);
    background: var(--surface, #ffffff);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.mood-note-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.mood-note-head h3 { margin: 0; font-size: 1rem; }

.mood-note-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin: 0 0 10px;
}

.mood-note-text {
    width: 100%;
    border: 1.5px solid #f3e8ff;
    border-radius: 12px;
    padding: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
}

.mood-note-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.mood-editor-locked {
    padding: 14px;
    border-radius: 14px;
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    font-size: 0.82rem;
    color: #9d174d;
    margin-bottom: 12px;
}

.mood-entry-note-btn {
    font-size: 0.72rem;
}

.mood-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 16px;
}

/* dashboard widget — compact */
.dash-mood-card {
    background: var(--surface, #ffffff);
    border: 1px solid var(--glass-border, rgba(139, 92, 246, 0.15));
    border-radius: 16px;
    padding: 10px 12px;
    margin-bottom: 14px;
    box-shadow: var(--shadow, 0 8px 32px rgba(109, 40, 217, 0.08));
}

.dash-mood-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.dash-mood-head h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 800;
}

.dash-mood-link {
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--purple-100, #ede9fe);
    color: var(--purple-700, #6d28d9);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}

.dash-mood-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-mood-val {
    min-width: 2.4rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--purple-700, #6d28d9);
}

.dash-mood-row input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: var(--purple-600, #7c3aed);
    height: 22px;
}

.dash-mood-feelings {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.dash-mood-feelings.is-empty {
    display: none;
}

.dash-mood-feeling {
    flex: 0 0 auto;
    min-width: 34px;
    padding: 5px 7px;
    border-radius: 8px;
    border: 1px solid var(--purple-100, #ede9fe);
    background: var(--purple-50, #f5f3ff);
    font-size: 1.05rem;
    line-height: 1;
    text-align: center;
    cursor: pointer;
    font-family: inherit;
}

.dash-mood-feeling.selected {
    border-color: var(--purple-600, #7c3aed);
    background: var(--purple-100, #ede9fe);
}

.dash-mood-save {
    flex-shrink: 0;
    min-width: 52px;
    padding: 6px 12px;
    border: none;
    border-radius: 8px;
    background: var(--purple-600, #7c3aed);
    color: white;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.dash-mood-save:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.dash-mood-locked.hidden,
#dash-mood-editor.hidden {
    display: none !important;
}

.dash-mood-locked-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--purple-50, #f5f3ff);
    border: 1px solid var(--purple-100, #ede9fe);
}

.dash-mood-locked-emoji {
    font-size: 1.5rem;
    line-height: 1;
}

.dash-mood-locked-card strong {
    display: block;
    font-size: 0.82rem;
}

.dash-mood-locked-card p {
    margin: 1px 0 0;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.dash-mood-wait {
    color: var(--purple-700, #6d28d9) !important;
    font-weight: 600;
    margin-top: 4px !important;
}

.dash-mood-note-btn {
    margin-top: 6px;
    font-size: 0.68rem;
    padding: 4px 8px;
    border-radius: 7px;
    border: 1px solid var(--purple-200, #ddd6fe);
    background: var(--surface, #ffffff);
    color: var(--purple-700, #6d28d9);
    cursor: pointer;
}

.dash-mood-note-btn:hover {
    background: var(--purple-50, #f5f3ff);
}

/* ── Dark theme ── */
html[data-theme="dark"] {
    --mood-accent-soft: rgba(236, 72, 153, 0.18);
}
html[data-theme="dark"] .mood-body { background: #090b14 !important; }
html[data-theme="dark"] .mood-view-tab:not(.active),
html[data-theme="dark"] .mood-card,
html[data-theme="dark"] .mood-panel,
html[data-theme="dark"] .mood-note-card,
html[data-theme="dark"] .month-cell {
    background: #171c2f !important;
    color: #f1f5ff !important;
    border-color: rgba(236, 72, 153, 0.25) !important;
}
html[data-theme="dark"] .month-cell.has-mood {
    background: rgba(236, 72, 153, 0.22) !important;
    color: #fbcfe8 !important;
    border-color: rgba(249, 168, 212, 0.45) !important;
}
html[data-theme="dark"] .mood-analysis { color: #f5d0fe !important; }
/* ── اسپانسر هدر ── */
.mood-mobile-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.mood-view-tabs {
    align-items: center;
}
.mood-desktop-sponsors {
    margin-right: auto;
}
.mood-body .spn-chip {
    border-color: rgba(236, 72, 153, 0.28);
    background: linear-gradient(135deg, #fff, #fce7f3);
    box-shadow: 0 6px 16px rgba(219, 39, 119, 0.12);
    color: #831843;
}
.mood-body .spn-chip:hover {
    border-color: rgba(139, 92, 246, 0.45);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.16);
}
.mood-body .spn-kicker { color: #db2777; }
.mood-body .spn-name { color: #9d174d; }
.mood-body .spn-avatar {
    background: linear-gradient(135deg, #db2777, #8b5cf6);
}
html[data-theme="dark"] .mood-body .spn-chip {
    background: rgba(23, 28, 47, 0.92);
    border-color: rgba(236, 72, 153, 0.35);
    color: #fce7f3;
}
html[data-theme="dark"] .mood-body .spn-name { color: #f9a8d4; }
