/* ═══════════════════════════════════════════════════════════════
   TU ZEN DASHBOARD — Japandi & Wabi-sabi Style System
   Breathing UI / Organic Shapes / Glassmorphism
   ═══════════════════════════════════════════════════════════════ */

/* ── Dashboard Container ── */
.tu-dashboard-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 940px;
    margin: 0 auto;
    padding: 1rem 0;
    animation: tu-dash-reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(12px);
}

.tu-dashboard-greeting {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 0.5rem;
}

.tu-dashboard-greeting h2 {
    font-family: 'Cactus', serif;
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
}

.tu-dashboard-greeting p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ── Feature Cards — Organic Wabi-sabi ── */
.tu-feature-card {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(42, 59, 50, 0.08);
    border-radius: 22px;
    padding: 28px 24px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.3s ease,
        border-color 0.3s ease;
    animation: tu-breathe-subtle 8s infinite ease-in-out;
}

.tu-feature-card:nth-child(even) {
    animation-delay: 2s;
}

.tu-feature-card:nth-child(3n) {
    animation-delay: 4s;
}

.tu-feature-card:hover {
    transform: scale(1.018) translateY(-3px);
    box-shadow: 0 12px 40px rgba(42, 59, 50, 0.08);
    border-color: rgba(42, 59, 50, 0.15);
}

.tu-feature-card:active {
    transform: scale(0.985);
    box-shadow: 0 4px 15px rgba(42, 59, 50, 0.05);
}

/* Card inner layout */
.tu-card-icon {
    font-size: 2rem;
    margin-bottom: 14px;
    display: inline-block;
    animation: tu-float-icon 6s infinite ease-in-out;
}

.tu-card-title {
    font-family: 'Cactus', serif;
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.tu-card-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.5;
}

/* Decorative ink-bleed corner */
.tu-feature-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(42, 59, 50, 0.02);
    filter: blur(15px);
    pointer-events: none;
    transition: opacity 0.3s;
}

.tu-feature-card:hover::before {
    opacity: 0.7;
}

/* ── Daily Verse Card (Dhammapada) — Full Width ── */
.tu-verse-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(226, 232, 213, 0.35), rgba(240, 230, 210, 0.25));
    border: 1px solid rgba(42, 59, 50, 0.06);
    border-radius: 24px;
    padding: 32px 28px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tu-verse-content {
    position: relative;
    z-index: 1;
}

.tu-verse-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 500;
}

.tu-verse-text {
    font-family: 'Cactus', serif;
    font-size: 1.25rem;
    line-height: 1.65;
    color: var(--text-primary);
    font-weight: 400;
    margin-bottom: 16px;
    max-width: 640px;
}

.tu-verse-ref {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 18px;
}

.tu-verse-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(42, 59, 50, 0.12);
}

.tu-verse-action:hover {
    background: var(--btn-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(42, 59, 50, 0.18);
}

.tu-verse-action:active {
    transform: scale(0.97);
}

.tu-verse-action svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Decorative ensō (circle) behind verse */
.tu-verse-card::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -20px;
    width: 200px;
    height: 200px;
    border: 2px solid rgba(42, 59, 50, 0.04);
    border-radius: 50%;
    pointer-events: none;
}

/* ── Writing for Today — Daily Reflection ── */
.tu-writing-card {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(42, 59, 50, 0.08);
    border-radius: 24px;
    padding: 28px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.tu-writing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.tu-writing-label {
    font-family: 'Cactus', serif;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.tu-writing-date {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* Emoji Picker Row */
.tu-emoji-picker {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tu-emoji-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    border: 1.5px solid rgba(42, 59, 50, 0.1);
    background: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tu-emoji-btn:hover {
    transform: scale(1.12) translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 59, 50, 0.08);
    border-color: rgba(42, 59, 50, 0.2);
}

.tu-emoji-btn.selected {
    border-color: var(--accent);
    background: rgba(74, 93, 78, 0.08);
    transform: scale(1.08);
    box-shadow: 0 0 0 3px rgba(74, 93, 78, 0.1);
}

.tu-emoji-btn:active {
    transform: scale(0.95);
}

/* Textarea */
.tu-writing-textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid rgba(42, 59, 50, 0.1);
    border-radius: 16px;
    padding: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.4);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tu-writing-textarea::placeholder {
    color: rgba(42, 59, 50, 0.35);
    font-style: italic;
}

.tu-writing-textarea:focus {
    border-color: rgba(42, 59, 50, 0.25);
    box-shadow: 0 0 0 3px rgba(42, 59, 50, 0.05);
}

/* Save button */
.tu-writing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}

.tu-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    padding: 10px 24px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(42, 59, 50, 0.1);
}

.tu-save-btn:hover {
    background: var(--btn-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(42, 59, 50, 0.15);
}

.tu-save-btn:active {
    transform: scale(0.97);
}

.tu-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.tu-save-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.tu-save-status {
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.4s;
}

.tu-save-status.show {
    opacity: 1;
}

/* ── Immersive Breathing Overlay ── */
.tu-breathing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #f2f0eb 0%, #e8e4dc 50%, #ddd8cf 100%);
    z-index: 10003;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.tu-breathing-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.tu-breathing-close {
    position: absolute;
    top: 32px;
    right: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(42, 59, 50, 0.15);
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.tu-breathing-close:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    transform: scale(1.05);
}

.tu-breathing-close svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Breathing Lotus Circle */
.tu-breathing-circle-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.tu-breathing-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, rgba(74, 93, 78, 0.15), rgba(42, 59, 50, 0.08));
    border: 2px solid rgba(42, 59, 50, 0.1);
    transition: transform 4s cubic-bezier(0.37, 0, 0.63, 1), background 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tu-breathing-circle.inhale {
    transform: scale(1.6);
    background: radial-gradient(circle at 40% 40%, rgba(74, 93, 78, 0.25), rgba(42, 59, 50, 0.12));
}

.tu-breathing-circle.hold {
    transform: scale(1.6);
}

.tu-breathing-circle.exhale {
    transform: scale(1);
    background: radial-gradient(circle at 40% 40%, rgba(74, 93, 78, 0.1), rgba(42, 59, 50, 0.05));
}

.tu-breathing-label {
    font-family: 'Cactus', serif;
    font-size: 1.3rem;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    user-select: none;
}

.tu-breathing-timer {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 10px;
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* Ring ripple behind circle */
.tu-breathing-ring {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 1px solid rgba(42, 59, 50, 0.04);
    pointer-events: none;
    animation: tu-ring-expand 8s infinite ease-out;
}

.tu-breathing-ring:nth-child(2) {
    animation-delay: 2s;
}

.tu-breathing-ring:nth-child(3) {
    animation-delay: 4s;
}

/* Breathing session info */
.tu-breathing-info {
    text-align: center;
    margin-top: 24px;
}

.tu-breathing-elapsed {
    font-size: 2rem;
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.tu-breathing-cycle-count {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 300;
}

/* Breathing control buttons */
.tu-breathing-controls {
    margin-top: 32px;
    display: flex;
    gap: 12px;
}

.tu-breathing-btn {
    padding: 12px 28px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tu-breathing-btn-primary {
    background: var(--btn-bg);
    color: var(--btn-text);
    border: none;
    box-shadow: 0 4px 15px rgba(42, 59, 50, 0.12);
}

.tu-breathing-btn-primary:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 59, 50, 0.18);
}

.tu-breathing-btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(42, 59, 50, 0.15);
}

.tu-breathing-btn-secondary:hover {
    border-color: rgba(42, 59, 50, 0.3);
    color: var(--text-primary);
}

/* ── Toast Notification — Sumi-e style ── */
.tu-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(42, 59, 50, 0.92);
    color: #f0ede8;
    padding: 14px 28px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 400;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 30px rgba(42, 59, 50, 0.2);
    z-index: 10004;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    max-width: 400px;
}

.tu-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ── Animations ── */
@keyframes tu-dash-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tu-breathe-subtle {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.993);
    }
}

@keyframes tu-float-icon {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes tu-ring-expand {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .tu-dashboard-container {
        grid-template-columns: 1fr;
        padding: 0.5rem;
        gap: 14px;
    }

    .tu-dashboard-greeting h2 {
        font-size: 1.6rem;
    }

    .tu-feature-card {
        padding: 22px 18px;
    }

    .tu-verse-text {
        font-size: 1.05rem;
    }

    .tu-breathing-overlay {
        padding: 20px;
    }

    .tu-breathing-circle {
        width: 120px;
        height: 120px;
    }

    .tu-breathing-ring {
        width: 120px;
        height: 120px;
    }

    .tu-breathing-close {
        top: 20px;
        right: 20px;
    }

    .tu-emoji-btn {
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }

    .tu-toast {
        width: calc(100% - 32px);
        max-width: none;
    }
}
