/* SoulScript - Premium Visuals & Animations */

.page-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -10;
    pointer-events: none;
    opacity: 0.65;
}

.tool-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 2.5rem 1rem 4rem;
    display: grid;
    gap: 2rem;
    position: relative;
}

/* Background Ambient Glow */
.tool-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(circle, rgba(246, 136, 39, 0.08) 0%, rgba(139, 92, 246, 0.04) 50%, transparent 70%);
    z-index: -1;
    pointer-events: none;
    transition: background 0.5s ease;
}

/* Tradition Selector Tabs */
.tradition-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    padding: 0.6rem;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.tradition-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.tradition-btn:hover {
    color: var(--color-text);
    background: rgba(0, 0, 0, 0.04);
}

.tradition-btn.active {
    background: #0B1220;
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(11, 18, 32, 0.15);
}

/* Mood Grid */
.mood-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.85rem;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.mood-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.1rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.mood-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: currentColor;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.mood-btn:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    border-color: currentColor;
}

.mood-btn[aria-pressed="true"] {
    border-color: currentColor;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06), 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.mood-emoji {
    font-size: 2.25rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.mood-btn:hover .mood-emoji {
    transform: scale(1.15) rotate(5deg);
}

.mood-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

/* Mood-specific colors */
.mood-btn[data-mood="happy"] { color: #F59E0B; }
.mood-btn[data-mood="sad"] { color: #6366F1; }
.mood-btn[data-mood="peaceful"] { color: #10B981; }
.mood-btn[data-mood="anxious"] { color: #F97316; }
.mood-btn[data-mood="lazy"] { color: #8B5CF6; }
.mood-btn[data-mood="angry"] { color: #EF4444; }
.mood-btn[data-mood="lonely"] { color: #64748B; }
.mood-btn[data-mood="motivated"] { color: #EAB308; }
.mood-btn[data-mood="cozy"] { color: #B45309; }
.mood-btn[data-mood="grateful"] { color: #EC4899; }
.mood-btn[data-mood="hopeful"] { color: #14B8A6; }
.mood-btn[data-mood="confused"] { color: #0EA5E9; }

/* Mood active background tints */
.mood-btn[data-mood="happy"][aria-pressed="true"] { background: #FEF3C7; }
.mood-btn[data-mood="sad"][aria-pressed="true"] { background: #E0E7FF; }
.mood-btn[data-mood="peaceful"][aria-pressed="true"] { background: #D1FAE5; }
.mood-btn[data-mood="anxious"][aria-pressed="true"] { background: #FFEDD5; }
.mood-btn[data-mood="lazy"][aria-pressed="true"] { background: #EDE9FE; }
.mood-btn[data-mood="angry"][aria-pressed="true"] { background: #FEE2E2; }
.mood-btn[data-mood="lonely"][aria-pressed="true"] { background: #F1F5F9; }
.mood-btn[data-mood="motivated"][aria-pressed="true"] { background: #FEF9C3; }
.mood-btn[data-mood="cozy"][aria-pressed="true"] { background: #FEF3C7; }
.mood-btn[data-mood="grateful"][aria-pressed="true"] { background: #FCE7F3; }
.mood-btn[data-mood="hopeful"][aria-pressed="true"] { background: #CCFBF1; }
.mood-btn[data-mood="confused"][aria-pressed="true"] { background: #E0F2FE; }

/* Quote Card with Glassmorphism */
.quote-card {
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 250, 252, 0.9) 100%);
    backdrop-filter: blur(16px);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.quote-card.mood-active {
    border-left: 6px solid currentColor;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
}

.quote-card[data-mood="happy"] { color: #F59E0B; }
.quote-card[data-mood="sad"] { color: #6366F1; }
.quote-card[data-mood="peaceful"] { color: #10B981; }
.quote-card[data-mood="anxious"] { color: #F97316; }
.quote-card[data-mood="lazy"] { color: #8B5CF6; }
.quote-card[data-mood="angry"] { color: #EF4444; }
.quote-card[data-mood="lonely"] { color: #64748B; }
.quote-card[data-mood="motivated"] { color: #EAB308; }
.quote-card[data-mood="cozy"] { color: #B45309; }
.quote-card[data-mood="grateful"] { color: #EC4899; }
.quote-card[data-mood="hopeful"] { color: #14B8A6; }
.quote-card[data-mood="confused"] { color: #0EA5E9; }

.quote-container {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.quote-text {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.65;
    font-style: italic;
    max-width: 750px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.quote-text::before {
    content: '"';
    font-size: 4rem;
    color: currentColor;
    opacity: 0.2;
    display: block;
    line-height: 0.5;
    margin-bottom: 0.5rem;
    font-family: Georgia, serif;
}

.quote-author {
    margin-top: 1.25rem;
    font-size: 1.05rem;
    color: var(--color-text-secondary);
    font-weight: 700;
    letter-spacing: -0.01em;
    animation: fadeIn 0.8s ease;
}

.quote-author::before {
    content: '— ';
}

/* Quote Actions */
.quote-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    padding: 1.25rem 1rem 1rem;
    border-top: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.5);
}

.quote-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.65rem 1.1rem;
    border-radius: 12px;
    transition: all 0.25s ease;
}

.quote-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.quote-actions .btn span {
    font-size: 1.1rem;
}

#favoriteBtn.is-saved span {
    color: #EC4899;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: #0B1220;
    color: #FFFFFF;
    padding: 0.85rem 1.75rem;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    backdrop-filter: blur(8px);
}

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

/* Favorites Section */
.favorites-card {
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
}

.favorites-card .card__body {
    padding: 1rem 1.5rem;
}

.favorites-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    cursor: pointer;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.favorites-toggle:hover {
    color: var(--jb-orange);
}

.favorites-count {
    background: var(--jb-orange);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    margin-left: auto;
}

.favorites-list {
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.75rem;
}

.favorites-list:not([hidden]) {
    animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.no-favorites {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    padding: 1.5rem 0;
    text-align: center;
}

.favorite-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--color-border);
}

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

.favorite-quote {
    flex: 1;
}

.favorite-quote-text {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.6;
    font-style: italic;
}

.favorite-quote-author {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-top: 0.3rem;
    font-weight: 600;
}

.favorite-actions button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.favorite-actions button:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Tool Content */
.tool-content {
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
}

.tool-content h2 {
    margin: 1.75rem 0 0.75rem;
    font-size: 1.35rem;
}

.tool-content h2:first-child {
    margin-top: 0;
}

.tool-content h3 {
    margin: 1.3rem 0 0.4rem;
    font-size: 1.1rem;
}

.tool-content p,
.tool-content li {
    color: var(--color-text-secondary);
    line-height: 1.75;
}

.tool-updated {
    font-size: 0.85rem;
    margin-top: 2rem;
    color: var(--color-text-secondary);
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 600px) {
    .tradition-selector {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.4rem;
        padding: 0.5rem;
    }

    .tradition-btn {
        width: 100%;
        text-align: center;
        padding: 0.7rem 0.4rem;
        font-size: 0.85rem;
        white-space: normal;
    }

    .mood-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .mood-btn {
        padding: 0.85rem 0.5rem;
        border-radius: 12px;
    }
    
    .mood-emoji {
        font-size: 1.75rem;
    }
    
    .mood-label {
        font-size: 0.8rem;
    }
    
    .quote-text {
        font-size: 1.2rem;
    }
    
    .quote-actions {
        flex-direction: column;
    }
    
    .quote-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
