/* ===== MOTIVATION MODULE ===== */
/* Fully self-contained. Remove this file + motivation.js to disable. */

/* --- Shared overlay --- */
.motivation-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex; align-items: center; justify-content: center;
}
.motivation-overlay.visible { opacity: 1; }
.motivation-overlay.hidden { pointer-events: none; opacity: 0; }

/* --- Welcome Modal --- */
.motivation-welcome {
    background: var(--bg-secondary, #111);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 20px;
    padding: 3rem 2.5rem;
    max-width: 480px; width: 90%;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 80px rgba(59,130,246,0.08);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
    position: relative;
    overflow: hidden;
}
.motivation-overlay.visible .motivation-welcome {
    transform: scale(1) translateY(0);
    opacity: 1;
}
.motivation-welcome::before {
    content: '';
    position: absolute; top: -60%; left: -20%; width: 140%; height: 100%;
    background: radial-gradient(ellipse, rgba(59,130,246,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.motivation-welcome-icon {
    font-size: 3.5rem; margin-bottom: 1.2rem;
    display: inline-block;
    animation: motivation-bounce 0.6s ease 0.4s both;
}
@keyframes motivation-bounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.motivation-welcome h2 {
    font-family: 'Outfit', var(--font-sans, sans-serif);
    font-size: 1.8rem; font-weight: 700; letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary, #ededed), var(--brand-primary, #3b82f6));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.motivation-welcome p {
    color: var(--text-secondary, #a1a1aa);
    font-size: 1rem; line-height: 1.7;
    margin-bottom: 1.8rem;
}
.motivation-welcome p em {
    color: var(--text-primary, #ededed);
    font-style: normal; font-weight: 500;
}
.motivation-welcome-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--brand-primary, #3b82f6);
    color: #fff; border: none; border-radius: 12px;
    padding: 0.85rem 2rem; font-family: inherit;
    font-size: 0.95rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(59,130,246,0.3);
}
.motivation-welcome-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59,130,246,0.4);
}
.motivation-welcome-btn:active { transform: translateY(0); }
.motivation-welcome-btn:focus-visible {
    outline: 2px solid var(--brand-primary, #3b82f6);
    outline-offset: 3px;
}

/* --- Daily Toast --- */
.motivation-toast {
    position: fixed;
    top: 1.5rem; right: 1.5rem;
    z-index: 9999;
    background: var(--bg-secondary, #111);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 16px;
    padding: 1.5rem 1.8rem;
    max-width: 380px; width: calc(100% - 3rem);
    box-shadow: 0 15px 40px rgba(0,0,0,0.4), 0 0 50px rgba(59,130,246,0.06);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    opacity: 0;
}
.motivation-toast.visible {
    transform: translateX(0);
    opacity: 1;
}
.motivation-toast.hidden {
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}
.motivation-toast-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 0.8rem;
}
.motivation-toast-streak {
    display: flex; align-items: center; gap: 0.5rem;
    font-family: 'Outfit', var(--font-sans, sans-serif);
    font-size: 1.1rem; font-weight: 700;
    color: var(--text-primary, #ededed);
}
.motivation-toast-streak .fire { font-size: 1.3rem; }
.motivation-toast-close {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted, #71717a); font-size: 1.2rem;
    padding: 0.2rem; border-radius: 6px;
    transition: all 0.15s; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
}
.motivation-toast-close:hover {
    background: var(--sidebar-hover, rgba(255,255,255,0.06));
    color: var(--text-primary, #ededed);
}
.motivation-toast-close:focus-visible {
    outline: 2px solid var(--brand-primary, #3b82f6);
    outline-offset: 2px;
}
.motivation-toast-quote {
    color: var(--text-secondary, #a1a1aa);
    font-size: 0.92rem; line-height: 1.6;
    font-style: italic;
    border-left: 3px solid var(--brand-primary, #3b82f6);
    padding-left: 0.8rem;
    margin: 0;
}
.motivation-toast-progress {
    margin-top: 1rem;
    height: 3px; border-radius: 2px;
    background: var(--border, rgba(255,255,255,0.1));
    overflow: hidden;
}
.motivation-toast-progress-fill {
    height: 100%; border-radius: 2px;
    background: linear-gradient(90deg, var(--brand-primary, #3b82f6), #8b5cf6);
    transition: width 0.1s linear;
    width: 100%;
}

/* --- Top Bar Streak Widget --- */
.motivation-streak-widget {
    display: flex; align-items: center; gap: 0.4rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-primary, #ededed);
    background: var(--sidebar-bg, #0c0c0c);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    padding: 0.3rem 0.7rem; border-radius: 8px;
    cursor: default;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.motivation-streak-widget:hover {
    border-color: var(--border-hover, rgba(255,255,255,0.2));
}
.motivation-streak-widget .fire {
    font-size: 0.95rem;
    animation: motivation-fire-pulse 2s ease-in-out infinite;
}
@keyframes motivation-fire-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* --- Milestone Celebration --- */
.motivation-milestone {
    position: fixed; inset: 0;
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.motivation-milestone.visible {
    opacity: 1; pointer-events: auto;
}
.motivation-milestone-card {
    background: var(--bg-secondary, #111);
    border: 1px solid rgba(250, 204, 21, 0.2);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 380px; width: 90%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 100px rgba(250,204,21,0.08);
    transform: scale(0.85);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.motivation-milestone.visible .motivation-milestone-card {
    transform: scale(1);
}
.motivation-milestone-icon {
    font-size: 4rem; margin-bottom: 1rem;
    display: inline-block;
    animation: motivation-trophy-spin 0.8s ease 0.3s both;
}
@keyframes motivation-trophy-spin {
    0% { transform: rotateY(180deg) scale(0); opacity: 0; }
    100% { transform: rotateY(0) scale(1); opacity: 1; }
}
.motivation-milestone h3 {
    font-family: 'Outfit', var(--font-sans, sans-serif);
    font-size: 1.5rem; font-weight: 700;
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, #facc15, #f97316);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.motivation-milestone p {
    color: var(--text-secondary, #a1a1aa);
    font-size: 0.9rem; margin-bottom: 1.5rem;
}
.motivation-milestone-btn {
    background: linear-gradient(135deg, #facc15, #f97316);
    color: #000; border: none; border-radius: 10px;
    padding: 0.7rem 1.8rem;
    font-family: inherit; font-size: 0.9rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
}
.motivation-milestone-btn:hover { transform: translateY(-2px); }
.motivation-milestone-btn:focus-visible {
    outline: 2px solid #facc15;
    outline-offset: 3px;
}

/* --- Confetti Particles --- */
.motivation-confetti {
    position: fixed; inset: 0; z-index: 10001;
    pointer-events: none; overflow: hidden;
}
.motivation-confetti-piece {
    position: absolute;
    width: 8px; height: 8px;
    border-radius: 2px;
    top: -10px;
    animation: motivation-confetti-fall 2.5s ease-out forwards;
}
@keyframes motivation-confetti-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .motivation-welcome { padding: 2rem 1.5rem; }
    .motivation-welcome h2 { font-size: 1.4rem; }
    .motivation-toast { top: 1rem; right: 1rem; max-width: calc(100% - 2rem); }
    .motivation-streak-widget span.streak-label { display: none; }
}
