/* ========================================
   マインドフルネス・セルフケア スタイル（強化版）
   ======================================== */

.mindfulness-section {
    margin-top: 30px;
    padding: 24px;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.mindfulness-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mindfulness-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 500px) {
    .mindfulness-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ---- マインドカード ---- */
.mind-card {
    background: rgba(99, 102, 241, 0.04);
    border: 1px solid var(--border);
    padding: 20px 12px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.mind-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-button);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.mind-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 28px -8px rgba(99, 102, 241, 0.25);
    border-color: var(--primary-light);
}

.mind-card:hover::before { opacity: 0.06; }

.mind-card-icon {
    font-size: 30px;
    margin-bottom: 10px;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.mind-card-title {
    font-weight: 700;
    font-size: 12px;
    color: var(--text);
    position: relative;
    z-index: 1;
    line-height: 1.4;
}

/* ---- モーダル共通 ---- */
.mind-modal-wide {
    max-width: 520px !important;
}

.mind-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}

.mind-empty {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 12px 0;
}

.breathing-container {
    text-align: center;
    padding: 32px 20px;
}

/* ========================================
   呼吸法 強化
   ======================================== */
.breath-pattern-selector {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.breath-pattern-btn {
    padding: 7px 14px;
    border-radius: 50px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.breath-pattern-btn.active,
.breath-pattern-btn:hover {
    background: var(--gradient-button);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* SVGリング */
.breath-ring-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
}

.breath-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.breath-ring-bg {
    fill: none;
    stroke: rgba(99, 102, 241, 0.12);
    stroke-width: 10;
}

.breath-ring-progress {
    fill: none;
    stroke: url(#breathGrad);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 502;
    stroke-dashoffset: 502;
    transition: stroke-dashoffset 4s linear;
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.5));
}

.breath-inner-circle {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 120px; height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, #818cf8, #6366f1);
    display: flex; align-items: center; justify-content: center;
    transition: transform 4s ease-in-out, background 4s ease;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.35);
}

.breath-icon { font-size: 36px; }

.breathing-instruction {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
    min-height: 36px;
}

.breath-phase-detail {
    font-size: 13px;
    color: var(--text-muted);
    min-height: 20px;
    margin-bottom: 16px;
}

.breath-start-btn {
    margin-top: 4px;
    padding: 12px 32px !important;
    font-size: 15px !important;
}

.breath-cycle-count {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    min-height: 20px;
}

/* ========================================
   気分トラッカー
   ======================================== */
.mood-selector-grid {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.mood-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 12px;
    border-radius: 18px;
    border: 2px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 68px;
    font-family: inherit;
}

.mood-select-btn:hover {
    transform: translateY(-4px) scale(1.05);
    border-color: var(--primary-light);
    box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.2);
}

.mood-select-btn.selected {
    background: var(--gradient-button);
    border-color: transparent;
    box-shadow: 0 8px 20px -6px rgba(99, 102, 241, 0.4);
}

.mood-select-btn.selected .mood-label { color: #fff; }

.mood-emoji { font-size: 28px; line-height: 1; }

.mood-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.mood-save-msg {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #10b981;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    margin-bottom: 20px;
    animation: fadeIn 0.4s ease;
}

.mood-history-section { margin-top: 24px; }

.mood-history-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.mood-history-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.mood-history-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    min-width: 48px;
    animation: fadeIn 0.4s ease;
}

.mood-history-date { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.mood-history-emoji { font-size: 22px; }

/* ========================================
   夜のルーティン
   ======================================== */
.routine-progress-bar-wrap {
    height: 8px;
    background: rgba(0,0,0,0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.routine-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.routine-progress-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
    font-weight: 600;
}

.routine-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.routine-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
}

.routine-item input[type="checkbox"] { display: none; }

.routine-item.done {
    background: rgba(99, 102, 241, 0.07);
    border-color: rgba(99, 102, 241, 0.3);
}

.routine-item.done .routine-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.routine-icon { font-size: 22px; flex-shrink: 0; }

.routine-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    transition: color 0.2s;
}

.routine-checkmark {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.routine-item.done .routine-checkmark {
    background: var(--gradient-button);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.routine-complete-msg {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.08));
    border-radius: 16px;
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
    animation: fadeIn 0.5s ease;
}

/* ========================================
   ポジティブ日記
   ======================================== */
.diary-prompt {
    background: rgba(99, 102, 241, 0.07);
    border-left: 4px solid var(--primary);
    padding: 14px 18px;
    border-radius: 0 14px 14px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.5;
}

.diary-history {
    margin-top: 24px;
    text-align: left;
}

.diary-entry {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.04);
    border-left: 3px solid var(--primary-light);
    margin-bottom: 8px;
    animation: fadeIn 0.4s ease;
}

.diary-date {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    flex-shrink: 0;
    padding-top: 2px;
}

.diary-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

/* ========================================
   アファメーション
   ======================================== */
.affirmation-card {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.7;
    color: var(--text);
    padding: 28px 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(236,72,153,0.05));
    border: 1px solid rgba(99,102,241,0.15);
    margin-bottom: 32px;
    animation: fadeIn 0.5s ease;
}

.affirmation-close {
    margin-top: 0 !important;
}

/* ========================================
   感謝の結晶
   ======================================== */
.gratitude-input-area {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gratitude-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    border-left: 4px solid var(--accent);
    margin-top: 8px;
    text-align: left;
    animation: fadeIn 0.5s ease;
}

/* ========================================
   アニメーション
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes breathing-in {
    from { transform: scale(1); }
    to   { transform: scale(1.8); }
}
@keyframes breathing-out {
    from { transform: scale(1.8); }
    to   { transform: scale(1); }
}
.animate-breathe-in  { animation: breathing-in  4s ease-in-out forwards; }
.animate-breathe-out { animation: breathing-out 4s ease-in-out forwards; }
