/* ============================================
   THÁNHCA.NET - Super Upgrade CSS v1
   Hero, Favorites, Forum, Liturgy Widget,
   Seasonal Themes, Micro-animations
   ============================================ */

/* ===================================================
   SEASONAL THEMES (Mùa Phụng Vụ)
   =================================================== */
:root {
    --season-color:     #6b4696;
    --season-gradient:  linear-gradient(135deg, #3d2066, #6b4696);
    --season-glow:      rgba(107,70,150,.3);
}
body[data-season="advent"] {
    --season-color:    #5b2d8e;
    --season-gradient: linear-gradient(135deg, #1e0a3c, #5b2d8e);
    --season-glow:     rgba(91,45,142,.3);
}
body[data-season="christmas"] {
    --season-color:    #b92020;
    --season-gradient: linear-gradient(135deg, #7a0000, #b92020);
    --season-glow:     rgba(185,32,32,.3);
}
body[data-season="lent"] {
    --season-color:    #6b4696;
    --season-gradient: linear-gradient(135deg, #3d2066, #6b4696);
    --season-glow:     rgba(107,70,150,.3);
}
body[data-season="easter"] {
    --season-color:    #c8963c;
    --season-gradient: linear-gradient(135deg, #855700, #c8963c);
    --season-glow:     rgba(200,150,60,.3);
}
body[data-season="ordinary"] {
    --season-color:    #1e7a1e;
    --season-gradient: linear-gradient(135deg, #0d4e0d, #1e7a1e);
    --season-glow:     rgba(30,122,30,.3);
}

/* ===================================================
   SUPER HERO SECTION (Trang chủ)
   =================================================== */
.super-hero {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 18px;
    min-height: 164px;
    max-height: 260px;
    background: var(--season-gradient);
    box-shadow: 0 6px 24px var(--season-glow), 0 1px 0 rgba(255,255,255,.08) inset;
    transition: opacity .34s ease, transform .34s ease, max-height .34s ease, margin .34s ease;
}
.super-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 80% 50%, rgba(255,255,255,.07), transparent),
        radial-gradient(ellipse 40% 60% at 10% 80%, rgba(0,0,0,.2), transparent);
    pointer-events: none;
}
.super-hero-cross {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10rem;
    opacity: .03;
    color: #fff;
    line-height: 1;
    pointer-events: none;
    font-weight: 900;
    animation: hero-pulse 4s ease-in-out infinite;
}
@keyframes hero-pulse {
    0%, 100% { opacity: .04; transform: translateY(-50%) scale(1); }
    50%       { opacity: .065; transform: translateY(-50%) scale(1.02); }
}
.super-hero-body {
    position: relative;
    z-index: 1;
    padding: 18px 22px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}
.super-hero-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.super-hero-eyebrow {
    font-size: .64rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.6);
    display: flex;
    align-items: center;
    gap: 6px;
}
.super-hero-eyebrow::before {
    content: '';
    width: 18px;
    height: 2px;
    background: rgba(255,255,255,.4);
    border-radius: 99px;
}
.super-hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.22rem, 2.2vw, 1.72rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.12;
    text-shadow: 0 2px 8px rgba(0,0,0,.24);
    margin: 0;
}
.super-hero-title span {
    color: var(--gold-light);
}
.super-hero-kicker {
    font-size: .82rem;
    font-weight: 700;
    color: rgba(255,255,255,.88);
    letter-spacing: .01em;
}
.super-hero-sub {
    font-size: .78rem;
    color: rgba(255,255,255,.72);
    line-height: 1.45;
    max-width: 420px;
    margin: 0;
}
.super-hero-cta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all .2s;
    text-decoration: none;
    white-space: nowrap;
}
.hero-btn-primary {
    background: rgba(255,255,255,.95);
    color: var(--purple-dark);
    box-shadow: 0 3px 10px rgba(0,0,0,.16);
}
.hero-btn-primary:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0,0,0,.18);
}
.hero-btn-outline {
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 1.5px solid rgba(255,255,255,.3);
    backdrop-filter: blur(4px);
}
.hero-btn-outline:hover {
    background: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.5);
    transform: translateY(-1px);
}
.super-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
}
.hero-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 70px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.1);
}
.hero-stat-value {
    font-size: 1.16rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    font-family: var(--font-display);
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.hero-stat-label {
    font-size: .62rem;
    color: rgba(255,255,255,.56);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
}
.super-hero.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
    margin-bottom: 0;
    pointer-events: none;
}

/* ===================================================
   LITURGY WIDGET (Widget Phụng Vụ Hôm Nay - enhanced)
   =================================================== */
.liturgy-today-widget {
    background: linear-gradient(135deg, rgba(61,32,102,.06), rgba(200,150,60,.04));
    border: 1px solid rgba(107,70,150,.18);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all .22s;
}
.liturgy-today-widget:hover {
    border-color: rgba(107,70,150,.32);
    box-shadow: 0 6px 24px rgba(61,32,102,.1);
    transform: translateY(-1px);
}
.liturgy-today-widget::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--season-gradient);
    border-radius: 4px 0 0 4px;
}
.liturgy-today-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.liturgy-today-tag {
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--season-color);
    display: flex;
    align-items: center;
    gap: 5px;
}
.liturgy-today-tag::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--season-color);
    animation: blink-dot 2s ease-in-out infinite;
}
@keyframes blink-dot {
    0%, 100% { opacity: 1; }
    50%       { opacity: .35; }
}
.liturgy-today-badge {
    font-size: .7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    background: var(--season-gradient);
    color: #fff;
    box-shadow: 0 2px 8px var(--season-glow);
}
.liturgy-today-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin: 0 0 4px;
    line-height: 1.3;
}
.liturgy-today-date {
    font-size: .8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.liturgy-today-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(107,70,150,.08);
}
.liturgy-today-songs-count {
    font-size: .78rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}
.liturgy-today-arrow {
    font-size: .8rem;
    font-weight: 700;
    color: var(--purple);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap .2s;
}
.liturgy-today-widget:hover .liturgy-today-arrow {
    gap: 8px;
}

/* ===================================================
   QUICK STATS ROW (Dashboard)
   =================================================== */
.quick-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.quick-stat {
    background: #fff;
    border: 1px solid rgba(107,70,150,.1);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(61,32,102,.06);
    transition: all .2s;
    cursor: default;
}
.quick-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(61,32,102,.1);
}
.quick-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.quick-stat-icon.purple { background: linear-gradient(135deg, #3d2066, #6b4696); }
.quick-stat-icon.gold   { background: linear-gradient(135deg, #8a5e00, #c8963c); }
.quick-stat-icon.green  { background: linear-gradient(135deg, #0d4e0d, #1e7a1e); }
.quick-stat-icon.red    { background: linear-gradient(135deg, #7a0000, #b92020); }
.quick-stat-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.quick-stat-value {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--purple-dark);
    line-height: 1;
    font-family: var(--font-display);
}
.quick-stat-label {
    font-size: .66rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 700;
    margin-top: 3px;
}

.about-story-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 20px;
}
.about-story-grid,
.about-guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.about-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.about-story-card,
.about-feature-card {
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(107,70,150,.1);
    border-radius: 18px;
    box-shadow: 0 6px 22px rgba(61,32,102,.08);
}
.about-story-card {
    padding: 20px 22px;
}
.about-story-card--intro {
    background:
        radial-gradient(circle at top right, rgba(200,150,60,.12), transparent 28%),
        linear-gradient(135deg, rgba(61,32,102,.04), rgba(255,255,255,.96));
}
.about-story-card--note {
    border-left: 4px solid rgba(200,150,60,.7);
}
.about-story-eyebrow {
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 10px;
}
.about-story-title {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: clamp(1.42rem, 2.4vw, 2rem);
    line-height: 1.18;
    color: var(--purple-dark);
}
.about-story-heading {
    margin: 0 0 10px;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--purple-dark);
}
.about-story-copy {
    margin: 0 0 12px;
    font-size: .92rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.about-story-copy:last-child {
    margin-bottom: 0;
}
.about-story-icon {
    font-size: 1.55rem;
    margin-bottom: 10px;
}
.about-story-cta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.about-feature-card {
    padding: 18px 18px 16px;
}
.about-feature-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(107,70,150,.08);
    color: var(--purple);
    font-size: .82rem;
    font-weight: 900;
    margin-bottom: 12px;
}
.about-feature-title {
    margin: 0 0 8px;
    font-size: .98rem;
    font-weight: 800;
    color: var(--purple-dark);
}
.about-feature-copy {
    margin: 0;
    font-size: .86rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.about-guide-list,
.about-guide-stats {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 9px;
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: .9rem;
}
.about-guide-stats {
    list-style: disc;
}

/* ===================================================
   FAVORITES SYSTEM (Yêu Thích)
   =================================================== */
.fav-btn-float {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 900;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c0356e, #e84393);
    color: #fff;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(232,67,147,.4);
    transition: all .25s;
}
.fav-btn-float:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(232,67,147,.55);
}
.fav-btn-float .fav-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fff;
    color: #c0356e;
    font-size: .6rem;
    font-weight: 900;
    min-width: 18px;
    height: 18px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid rgba(192,53,110,.2);
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.fav-btn-float.has-items {
    animation: fav-float-anim 3s ease-in-out infinite;
}
@keyframes fav-float-anim {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-4px); }
}

/* Favorites Panel */
.fav-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 340px;
    max-width: 92vw;
    background: #fff;
    box-shadow: -8px 0 40px rgba(61,32,102,.15);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.4,0,.2,1);
    border-radius: 16px 0 0 16px;
    pointer-events: auto;
    touch-action: pan-y;
}
.fav-panel.open {
    transform: translateX(0);
}
.fav-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1099;
    opacity: 0;
    pointer-events: none;
    transition: opacity .32s;
    backdrop-filter: blur(4px);
    touch-action: manipulation;
}
.fav-panel-overlay.open {
    opacity: 1;
    pointer-events: all;
}
.fav-panel-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(107,70,150,.1);
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(192,53,110,.06), rgba(232,67,147,.03));
}
.fav-panel-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 800;
    color: #c0356e;
    flex: 1;
}
.fav-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid rgba(107,70,150,.15);
    background: rgba(255,255,255,.9);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    color: var(--text-muted);
    position: relative;
    z-index: 2;
    touch-action: manipulation;
}
.fav-panel-close:hover {
    background: rgba(192,53,110,.08);
    color: #c0356e;
    border-color: rgba(192,53,110,.3);
}
body.fav-panel-open .fav-btn-float {
    opacity: 0;
    pointer-events: none;
}
.fav-btn-float.fav-btn-cooling,
.fav-btn-float[disabled] {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transform: scale(.92) !important;
}
.fav-panel-toolbar {
    padding: 12px 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(107,70,150,.08);
}
.fav-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.fav-panel-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}
.fav-panel-empty-icon {
    font-size: 3rem;
    opacity: .4;
}
.fav-panel-empty-text {
    font-size: .9rem;
    line-height: 1.5;
}
.fav-song-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(107,70,150,.1);
    background: rgba(255,255,255,.96);
    box-shadow: 0 2px 8px rgba(61,32,102,.05);
    cursor: pointer;
    transition: all .2s;
}
.fav-song-card:hover {
    border-color: rgba(192,53,110,.25);
    box-shadow: 0 4px 14px rgba(192,53,110,.1);
    transform: translateX(-2px);
}
.fav-song-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(192,53,110,.1), rgba(232,67,147,.06));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    color: #c0356e;
}
.fav-song-info {
    flex: 1;
    min-width: 0;
}
.fav-song-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--purple-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.fav-song-meta {
    font-size: .75rem;
    color: var(--text-muted);
}
.fav-song-remove {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    border: none;
    background: rgba(239,68,68,.07);
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    flex-shrink: 0;
    transition: all .15s;
    padding: 0;
}
.fav-song-remove:hover {
    background: rgba(239,68,68,.15);
}

/* Favorite star animation */
.star-btn.starring {
    animation: star-pop .35s cubic-bezier(.36,1.56,.64,1);
}
@keyframes star-pop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* ===================================================
   FORUM - FIRESTORE BASED
   =================================================== */
.forum-shell {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    align-items: start;
}
.forum-main { min-width: 0; }
.forum-sidebar { position: sticky; top: 16px; }

.forum-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.forum-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.forum-main-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin: 0;
}
.forum-online-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    background: rgba(16,185,129,.1);
    border: 1px solid rgba(16,185,129,.2);
    font-size: .65rem;
    font-weight: 800;
    color: #047857;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.forum-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: blink-dot 1.5s infinite;
}
.forum-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--purple-gradient);
    color: #fff;
    font-size: .88rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(61,32,102,.25);
    transition: all .2s;
    white-space: nowrap;
}
.forum-new-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(61,32,102,.35);
}

/* Forum Categories */
.forum-cats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.forum-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: 99px;
    border: 1.5px solid rgba(107,70,150,.15);
    background: rgba(255,255,255,.9);
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .18s;
}
.forum-cat-pill:hover {
    border-color: rgba(107,70,150,.35);
    color: var(--purple);
    background: rgba(107,70,150,.05);
}
.forum-cat-pill.active {
    background: var(--purple-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(61,32,102,.25);
}

/* Forum Thread List */
.forum-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.forum-thread-card {
    background: #fff;
    border: 1px solid rgba(107,70,150,.1);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 2px 8px rgba(61,32,102,.05);
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
    align-items: flex-start;
}
.forum-thread-card:hover {
    border-color: rgba(107,70,150,.25);
    box-shadow: 0 6px 20px rgba(61,32,102,.1);
    transform: translateY(-1px);
}
.forum-thread-card.pinned {
    border-color: rgba(200,150,60,.25);
    background: linear-gradient(180deg, rgba(200,150,60,.03), #fff);
}
.forum-thread-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--purple-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    font-weight: 800;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.9);
    box-shadow: 0 2px 8px rgba(61,32,102,.2);
    overflow: hidden;
}
.forum-thread-avatar img {
    width: 100%; height: 100%; object-fit: cover;
}
.forum-thread-body { min-width: 0; }
.forum-thread-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.forum-thread-cat-badge {
    font-size: .62rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.forum-cat-badge-general  { background: rgba(107,70,150,.12); color: #5b2d8e; }
.forum-cat-badge-songask  { background: rgba(59,130,246,.12); color: #1d4ed8; }
.forum-cat-badge-sharing  { background: rgba(16,185,129,.12); color: #047857; }
.forum-cat-badge-feedback { background: rgba(245,158,11,.12); color: #b45309; }
.forum-cat-badge-pinned   { background: rgba(200,150,60,.18); color: #7c5000; }
.forum-thread-title {
    font-size: .97rem;
    font-weight: 700;
    color: var(--purple-dark);
    margin: 0 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.forum-thread-card:hover .forum-thread-title { color: var(--purple); }
.forum-thread-preview {
    font-size: .8rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.forum-thread-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: .74rem;
    color: var(--text-muted);
}
.forum-thread-author { font-weight: 600; color: var(--text-secondary); }
.forum-thread-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    min-width: 52px;
}
.forum-thread-count {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: .76rem;
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(107,70,150,.06);
    padding: 3px 8px;
    border-radius: 99px;
}
.forum-thread-like {
    font-size: .74rem;
    color: #e74c3c;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Forum View (single thread) */
.forum-view-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 9px;
    background: rgba(255,255,255,.9);
    border: 1.5px solid rgba(107,70,150,.15);
    color: var(--purple-dark);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all .18s;
}
.forum-view-back:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: rgba(107,70,150,.05);
}
.forum-view-card {
    background: #fff;
    border: 1px solid rgba(107,70,150,.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(61,32,102,.08);
    margin-bottom: 16px;
}
.forum-view-header {
    padding: 20px 22px 16px;
    border-bottom: 1px solid rgba(107,70,150,.08);
    background: linear-gradient(180deg, rgba(107,70,150,.03), transparent);
}
.forum-view-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin: 0 0 10px;
    line-height: 1.3;
}
.forum-view-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: .78rem;
    color: var(--text-muted);
}

/* Reply Cards */
.forum-reply {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(107,70,150,.06);
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    align-items: flex-start;
    transition: background .15s;
}
.forum-reply:last-child { border-bottom: none; }
.forum-reply:hover { background: rgba(107,70,150,.02); }
.forum-reply-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3d2066, #6b4696);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    font-weight: 800;
    flex-shrink: 0;
}
.forum-reply-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.forum-reply-author {
    font-weight: 700;
    font-size: .88rem;
    color: var(--purple-dark);
}
.forum-reply-time {
    font-size: .74rem;
    color: var(--text-muted);
}
.forum-reply-admin-badge {
    font-size: .58rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 99px;
    background: var(--purple-gradient);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.forum-reply-body {
    font-size: .88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}
.forum-reply-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.forum-reply-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid rgba(231,76,60,.2);
    background: rgba(231,76,60,.05);
    color: #c0392b;
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}
.forum-reply-like-btn:hover {
    background: rgba(231,76,60,.12);
    border-color: rgba(231,76,60,.35);
}
.forum-reply-like-btn.liked {
    background: rgba(231,76,60,.15);
    border-color: rgba(231,76,60,.4);
}

/* Forum Reply Box */
.forum-reply-box {
    background: #fff;
    border: 1px solid rgba(107,70,150,.12);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 16px rgba(61,32,102,.07);
}
.forum-reply-box-title {
    font-size: .88rem;
    font-weight: 700;
    color: var(--purple-dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.forum-reply-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    border: 1.5px solid rgba(107,70,150,.15);
    border-radius: 10px;
    font-family: var(--font-primary);
    font-size: .9rem;
    color: var(--text-primary);
    background: rgba(248,245,255,.5);
    resize: vertical;
    transition: all .2s;
    outline: none;
    line-height: 1.6;
    box-sizing: border-box;
}
.forum-reply-textarea:focus {
    border-color: var(--purple);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(107,70,150,.1);
}
.forum-reply-textarea::placeholder { color: rgba(107,70,150,.4); }
.forum-reply-submit-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* New Thread Form */
.forum-new-thread-form {
    background: #fff;
    border: 1px solid rgba(107,70,150,.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(61,32,102,.07);
    margin-bottom: 16px;
}
.forum-form-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin: 0 0 16px;
}

/* Forum Sidebar */
.forum-rules-card,
.forum-hot-card {
    background: #fff;
    border: 1px solid rgba(107,70,150,.1);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(61,32,102,.05);
    margin-bottom: 14px;
}
.forum-sidebar-title {
    font-size: .82rem;
    font-weight: 800;
    color: var(--purple-dark);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.forum-rule-item {
    display: flex;
    gap: 8px;
    font-size: .8rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(107,70,150,.06);
}
.forum-rule-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.forum-rule-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--purple-gradient);
    color: #fff;
    font-size: .62rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.forum-hot-item {
    display: flex;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(107,70,150,.06);
    cursor: pointer;
    transition: color .15s;
}
.forum-hot-item:last-child { border-bottom: none; }
.forum-hot-item:hover .forum-hot-title { color: var(--purple); }
.forum-hot-rank {
    font-size: .7rem;
    font-weight: 900;
    color: var(--text-muted);
    width: 18px;
    flex-shrink: 0;
    padding-top: 1px;
}
.forum-hot-rank:nth-child(1) { color: #c8963c; }
.forum-hot-title {
    font-size: .82rem;
    color: var(--text-secondary);
    font-weight: 600;
    line-height: 1.4;
    transition: color .15s;
}

/* Loading skeleton */
.forum-skeleton {
    background: linear-gradient(90deg, rgba(107,70,150,.06) 25%, rgba(107,70,150,.1) 50%, rgba(107,70,150,.06) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===================================================
   SKELETON LOADING (Global)
   =================================================== */
.skeleton {
    background: linear-gradient(90deg,
        rgba(107,70,150,.07) 25%,
        rgba(107,70,150,.12) 50%,
        rgba(107,70,150,.07) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite;
    border-radius: 6px;
    display: block;
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.wide { width: 90%; }
.skeleton-text.mid  { width: 60%; }
.skeleton-text.slim { width: 40%; }
.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.skeleton-card {
    height: 82px;
    border-radius: 14px;
    margin-bottom: 10px;
}

/* ===================================================
   MICRO-ANIMATIONS (Global)
   =================================================== */
@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scale-in {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: scale(1); }
}
.anim-fade-up  { animation: fade-in-up .4s cubic-bezier(.25,.46,.45,.94) both; }
.anim-fade-in  { animation: fade-in .3s ease both; }
.anim-scale-in { animation: scale-in .3s cubic-bezier(.25,.46,.45,.94) both; }

/* Stagger children */
.stagger-children > * {
    animation: fade-in-up .4s cubic-bezier(.25,.46,.45,.94) both;
}
.stagger-children > *:nth-child(1) { animation-delay: .05s; }
.stagger-children > *:nth-child(2) { animation-delay: .10s; }
.stagger-children > *:nth-child(3) { animation-delay: .15s; }
.stagger-children > *:nth-child(4) { animation-delay: .20s; }
.stagger-children > *:nth-child(5) { animation-delay: .25s; }

/* ===================================================
   TOAST NOTIFICATION UPGRADE
   =================================================== */
.super-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 9999;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(61,32,102,.18), 0 1px 0 rgba(107,70,150,.1) inset;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 240px;
    max-width: 90vw;
    border-left: 4px solid var(--purple);
    font-size: .9rem;
    color: var(--text-primary);
    opacity: 0;
    pointer-events: none;
    transition: all .3s cubic-bezier(.25,.46,.45,.94);
}
.super-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: all;
}
.super-toast.success { border-color: #10b981; }
.super-toast.warning { border-color: #f59e0b; }
.super-toast.error   { border-color: #ef4444; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 900px) {
    .forum-shell {
        grid-template-columns: 1fr;
    }
    .forum-sidebar { display: none; }
    .quick-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .about-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .super-hero-body {
        grid-template-columns: 1fr;
        padding: 16px 16px;
    }
    .super-hero-stats {
        display: none;
    }
}
@media (max-width: 600px) {
    .quick-stats-row { grid-template-columns: 1fr 1fr; }
    .about-story-grid,
    .about-guide-grid,
    .about-feature-grid {
        grid-template-columns: 1fr;
    }
    .about-story-card,
    .about-feature-card {
        padding: 16px;
        border-radius: 16px;
    }
    .about-story-title {
        font-size: 1.2rem;
    }
    .about-story-cta {
        flex-direction: column;
    }
    .super-hero-title { font-size: 1.18rem; }
    .super-hero-kicker { font-size: .76rem; }
    .super-hero-sub { font-size: .74rem; }
    .super-hero-cta { flex-direction: column; }
    .hero-btn { width: 100%; justify-content: center; }
    .fav-panel { width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; top: auto; height: 85vh; transform: translateY(100%); }
    .fav-panel.open { transform: translateY(0); }
}

/* ===================================================
   RECENTLY VIEWED WIDGET
   =================================================== */
.recent-widget {
    background: #fff;
    border: 1px solid rgba(107,70,150,.1);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(61,32,102,.06);
}
.recent-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.recent-widget-title {
    font-size: .88rem;
    font-weight: 800;
    color: var(--purple-dark);
}
.recent-clear-btn {
    font-size: .72rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all .15s;
}
.recent-clear-btn:hover { background: rgba(239,68,68,.08); color: #ef4444; }
.recent-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
.recent-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(107,70,150,.08);
    background: rgba(248,245,255,.5);
    cursor: pointer;
    transition: all .18s;
}
.recent-item:hover {
    background: rgba(107,70,150,.05);
    border-color: rgba(107,70,150,.18);
    transform: translateY(-1px);
}
.recent-item-icon {
    font-size: 1rem;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(107,70,150,.07);
    display: flex;
    align-items: center;
    justify-content: center;
}
.recent-item-info { flex: 1; min-width: 0; }
.recent-item-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--purple-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.recent-item-meta {
    font-size: .7rem;
    color: var(--text-muted);
}
.recent-item-pdf {
    font-size: .6rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(239,68,68,.1);
    color: #b91c1c;
    border: none;
    cursor: pointer;
    letter-spacing: .05em;
    flex-shrink: 0;
}
.recent-item-pdf:hover { background: rgba(239,68,68,.18); }

/* ===================================================
   SMART SEARCH AUTOCOMPLETE
   =================================================== */
.autocomplete-box {
    position: absolute;
    z-index: 2000;
    background: #fff;
    border: 1.5px solid rgba(107,70,150,.2);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(61,32,102,.18);
    max-height: 380px;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity .18s, transform .18s;
    min-width: 280px;
}
.autocomplete-box.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}
.autocomplete-box::-webkit-scrollbar { width: 4px; }
.autocomplete-box::-webkit-scrollbar-thumb { background: rgba(107,70,150,.2); border-radius: 99px; }
.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background .12s;
    border-bottom: 1px solid rgba(107,70,150,.05);
}
.autocomplete-item:last-of-type { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.focused {
    background: rgba(107,70,150,.06);
}
.autocomplete-icon {
    font-size: 1rem;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: rgba(107,70,150,.07);
    display: flex;
    align-items: center;
    justify-content: center;
}
.autocomplete-copy { flex: 1; min-width: 0; }
.autocomplete-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--purple-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.autocomplete-meta {
    font-size: .74rem;
    color: var(--text-muted);
    display: block;
    margin-top: 1px;
}
.autocomplete-pdf {
    font-size: .58rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(239,68,68,.1);
    color: #b91c1c;
    letter-spacing: .05em;
    flex-shrink: 0;
}
.autocomplete-footer {
    padding: 8px 14px;
    font-size: .72rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(107,70,150,.08);
    background: rgba(107,70,150,.02);
    border-radius: 0 0 14px 14px;
}

/* ===================================================
   USER PROFILE PAGE
   =================================================== */
.profile-guest-wrap {
    max-width: 640px;
    margin: 0 auto;
}
.profile-guest-hero {
    text-align: center;
    padding: 40px 24px 32px;
    background: linear-gradient(135deg, rgba(61,32,102,.05), rgba(200,150,60,.03));
    border: 1px solid rgba(107,70,150,.12);
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(61,32,102,.07);
}
.profile-guest-icon {
    font-size: 3.5rem;
    color: var(--purple);
    opacity: .5;
    margin-bottom: 12px;
}
.profile-guest-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin: 0 0 10px;
}
.profile-guest-sub {
    font-size: .9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 20px;
}
.profile-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.profile-feature-card {
    background: #fff;
    border: 1px solid rgba(107,70,150,.1);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(61,32,102,.05);
    transition: all .2s;
}
.profile-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(61,32,102,.1);
}
.profile-feature-icon { font-size: 1.6rem; margin-bottom: 8px; }
.profile-feature-title { font-size: .88rem; font-weight: 700; color: var(--purple-dark); margin-bottom: 4px; }
.profile-feature-desc  { font-size: .76rem; color: var(--text-muted); line-height: 1.5; }

/* Logged in profile */
.profile-wrap { display: grid; gap: 16px; }
.profile-card {
    background: #fff;
    border: 1px solid rgba(107,70,150,.12);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(61,32,102,.08);
    position: relative;
}
.profile-card-bg {
    height: 80px;
    background: var(--purple-gradient);
    position: relative;
}
.profile-card-bg::after {
    content: '✝';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5rem;
    opacity: .06;
    color: #fff;
}
.profile-card-body {
    padding: 0 20px 20px;
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}
.profile-avatar-wrap {
    position: relative;
    margin-top: -36px;
    flex-shrink: 0;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--purple-gradient);
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(61,32,102,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 900;
    color: #fff;
    overflow: hidden;
}
.profile-avatar-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    color: #fff;
}
.profile-info { flex: 1; min-width: 0; padding-top: 8px; }
.profile-name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-email {
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.profile-join {
    font-size: .74rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.profile-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.profile-badge {
    font-size: .62rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 99px;
    letter-spacing: .04em;
}
.profile-badge.verified { background: rgba(16,185,129,.12); color: #047857; }
.profile-badge.google   { background: rgba(66,133,244,.12); color: #1d4ed8; }
.profile-badge.fb       { background: rgba(59,89,152,.12);  color: #1e3a8a; }
.profile-edit-btn {
    align-self: center;
    padding: 8px 14px;
    border-radius: 9px;
    border: 1.5px solid rgba(107,70,150,.18);
    background: rgba(255,255,255,.9);
    color: var(--purple-dark);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .18s;
    flex-shrink: 0;
}
.profile-edit-btn:hover { border-color: var(--purple); color: var(--purple); background: rgba(107,70,150,.05); }
.profile-edit-form { padding: 0 20px 20px; }

/* Stats Row */
.profile-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.profile-stat-card {
    background: #fff;
    border: 1px solid rgba(107,70,150,.1);
    border-radius: 14px;
    padding: 16px 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(61,32,102,.06);
    cursor: pointer;
    transition: all .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.profile-stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(61,32,102,.12); }
.profile-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.profile-stat-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--purple-dark);
    font-family: var(--font-display);
    line-height: 1;
}
.profile-stat-label {
    font-size: .65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .04em;
}

/* Panels */
.profile-panels { display: grid; gap: 14px; }
.profile-panel {
    background: #fff;
    border: 1px solid rgba(107,70,150,.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(61,32,102,.05);
}
.profile-panel-header {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(107,70,150,.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(107,70,150,.02);
}
.profile-panel-title {
    font-size: .9rem;
    font-weight: 800;
    color: var(--purple-dark);
}
.profile-panel-action {
    font-size: .74rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 7px;
    transition: all .15s;
}
.profile-panel-action:hover { background: rgba(239,68,68,.08); color: #ef4444; }
.profile-panel-body { padding: 4px 0; }
.profile-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(107,70,150,.06);
    flex-wrap: wrap;
}
.profile-setting-label { font-size: .88rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.profile-setting-sub   { font-size: .75rem; color: var(--text-muted); }
.profile-empty-small   { padding: 20px; font-size: .82rem; color: var(--text-muted); text-align: center; }

/* Recent grid in profile */
.profile-recent-list { padding: 12px; }
.profile-recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.profile-recent-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(107,70,150,.08);
    background: rgba(248,245,255,.5);
    cursor: pointer;
    transition: all .18s;
}
.profile-recent-card:hover { background: rgba(107,70,150,.07); border-color: rgba(107,70,150,.18); }
.profile-recent-icon { font-size: .9rem; flex-shrink: 0; }
.profile-recent-title {
    flex: 1;
    font-size: .82rem;
    font-weight: 600;
    color: var(--purple-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-recent-time {
    font-size: .65rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .profile-stats-row { grid-template-columns: repeat(2, 1fr); }
    .profile-features-grid { grid-template-columns: 1fr; }
    .profile-card-body { flex-direction: column; align-items: flex-start; }
    .profile-edit-btn { width: 100%; justify-content: center; text-align: center; }
}

/* ===================================================
   MASS SET PRINT MODAL
   =================================================== */
.massprint-modal-overlay {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 20px; overflow-y: auto;
    opacity: 0; pointer-events: none; transition: opacity .28s;
}
.massprint-modal-overlay.open { opacity: 1; pointer-events: all; }
.massprint-modal {
    background: #fff; border-radius: 20px;
    box-shadow: 0 24px 80px rgba(61,32,102,.25);
    width: 100%; max-width: 640px;
    display: flex; flex-direction: column;
    overflow: hidden;
    margin: auto;
}
.massprint-modal-header {
    padding: 18px 22px; display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid rgba(107,70,150,.1);
    background: linear-gradient(135deg, rgba(61,32,102,.04), transparent);
}
.massprint-modal-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; color: var(--purple-dark); margin: 0; }
.massprint-modal-close {
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid rgba(107,70,150,.15); background: rgba(255,255,255,.9);
    cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: all .15s;
}
.massprint-modal-close:hover { background: rgba(239,68,68,.08); color: #ef4444; border-color: rgba(239,68,68,.25); }
.massprint-modal-body { padding: 20px; overflow-y: auto; max-height: 80vh; }

/* Builder */
.massprint-section-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; color: var(--purple-dark); margin: 0; }
.massprint-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.massprint-cat-row {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 10px; position: relative;
}
.massprint-cat-label {
    display: flex; align-items: center; gap: 6px;
    font-size: .82rem; font-weight: 700; color: var(--text-secondary);
    min-width: 90px; flex-shrink: 0;
}
.massprint-cat-icon { font-size: 1rem; }
.massprint-song-input { margin-bottom: 0 !important; }
.massprint-suggest-box {
    position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 100;
    background: #fff; border: 1.5px solid rgba(107,70,150,.18);
    border-radius: 10px; box-shadow: 0 8px 24px rgba(61,32,102,.12);
    display: none; overflow: hidden;
}
.massprint-suggest-box.active { display: block; }
.massprint-suggest-item {
    padding: 9px 14px; font-size: .84rem; color: var(--text-secondary);
    cursor: pointer; border-bottom: 1px solid rgba(107,70,150,.05); transition: background .12s;
}
.massprint-suggest-item:last-child { border-bottom: none; }
.massprint-suggest-item:hover { background: rgba(107,70,150,.06); color: var(--purple-dark); }
.massprint-builder-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* Preview */
.massprint-preview-wrap { display: flex; flex-direction: column; gap: 14px; }
.massprint-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.massprint-card {
    border: 2px solid rgba(61,32,102,.12); border-radius: 16px; overflow: hidden;
    box-shadow: 0 8px 32px rgba(61,32,102,.1);
}
.massprint-card-header {
    background: linear-gradient(135deg, #3d2066, #6b4696);
    color: #fff; text-align: center; padding: 28px 24px; position: relative; overflow: hidden;
}
.massprint-card-cross {
    position: absolute; right: -10px; top: 50%; transform: translateY(-50%);
    font-size: 8rem; opacity: .05; line-height: 1; pointer-events: none;
}
.massprint-card-tagline { font-size: .65rem; letter-spacing: .2em; text-transform: uppercase; opacity: .65; margin-bottom: 8px; }
.massprint-card-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; margin: 0 0 10px; line-height: 1.2; }
.massprint-card-meta { font-size: .8rem; opacity: .72; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.massprint-card-divider {
    margin-top: 16px; color: rgba(255,255,255,.45);
    display: flex; align-items: center; gap: 0; font-size: .8rem;
}
.massprint-card-divider span:first-child,
.massprint-card-divider span:last-child { flex: 1; height: 1px; background: rgba(255,255,255,.2); display: block; }
.massprint-card-divider span:nth-child(2) { padding: 0 14px; font-size: .62rem; letter-spacing: .15em; text-transform: uppercase; }
.massprint-card-body { padding: 20px 24px; }
.massprint-song-row {
    display: grid; grid-template-columns: 32px 120px 1fr; gap: 12px;
    align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(61,32,102,.06);
}
.massprint-song-row:last-child { border-bottom: none; }
.massprint-song-num {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #3d2066, #6b4696); color: #fff;
    font-size: .8rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.massprint-song-cat { font-size: .82rem; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.massprint-song-name { font-size: .95rem; font-weight: 600; color: var(--purple-dark); }
.massprint-song-row.empty .massprint-song-name { color: #9ca3af; font-style: italic; font-weight: 400; }
.massprint-card-footer {
    background: rgba(61,32,102,.03); border-top: 1px solid rgba(61,32,102,.08);
    padding: 14px 24px; text-align: center; font-size: .78rem; color: var(--text-muted);
}

@media (max-width: 600px) {
    .massprint-form-grid { grid-template-columns: 1fr; }
    .massprint-song-row { grid-template-columns: 28px 90px 1fr; gap: 8px; }
    .massprint-cat-row { flex-direction: column; align-items: stretch; }
    .massprint-cat-label { min-width: unset; }
}

/* ===================================================
   ADVANCED SEARCH PAGE
   =================================================== */
.advsearch-wrap { display: flex; flex-direction: column; gap: 12px; }
.advsearch-bar-wrap { display: flex; gap: 10px; align-items: center; }
.advsearch-cats { display: flex; gap: 7px; flex-wrap: wrap; }
.advsearch-cat-pill {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px; border-radius: 99px;
    border: 1.5px solid rgba(107,70,150,.14); background: rgba(255,255,255,.9);
    font-size: .8rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all .18s;
}
.advsearch-cat-pill:hover { border-color: rgba(107,70,150,.3); color: var(--purple); }
.advsearch-cat-pill.active { background: var(--purple-gradient); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(61,32,102,.2); }
.advsearch-meta { font-size: .78rem; color: var(--text-muted); font-weight: 600; padding: 2px 0; }
.advsearch-results { display: flex; flex-direction: column; gap: 7px; }
.advsearch-card {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 14px; border-radius: 12px;
    border: 1px solid rgba(107,70,150,.1); background: rgba(255,255,255,.96);
    box-shadow: 0 1px 6px rgba(61,32,102,.05); cursor: pointer; transition: all .18s;
}
.advsearch-card:hover { border-color: rgba(107,70,150,.22); box-shadow: 0 4px 14px rgba(61,32,102,.09); transform: translateX(2px); }
.advsearch-card-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.advsearch-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.advsearch-card-info { min-width: 0; }
.advsearch-card-title { font-size: .92rem; font-weight: 700; color: var(--purple-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.advsearch-card-meta { display: flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--text-muted); }
.advsearch-card-actions { display: flex; gap: 5px; flex-shrink: 0; }
.advsearch-btn {
    height: 29px; border-radius: 7px; border: 1px solid rgba(107,70,150,.14);
    background: rgba(255,255,255,.9); cursor: pointer; font-size: .75rem; font-weight: 700;
    padding: 0 9px; display: flex; align-items: center; transition: all .15s; white-space: nowrap;
    color: var(--text-muted);
}
.advsearch-btn:hover { border-color: var(--purple); color: var(--purple); }
.advsearch-btn.pdf { background: linear-gradient(180deg,#fff5f5,#ffe4e6); color: #b91c1c; border-color: rgba(220,38,38,.2); }
.advsearch-btn.pdf:hover { background: linear-gradient(180deg,#ef4444,#b91c1c); color: #fff; border-color: transparent; }
.advsearch-btn.fav:hover, .advsearch-btn.fav.starred { color: #f39c12; border-color: #f39c12; }

/* ===================================================
   ANNOUNCEMENT BAR
   =================================================== */
.announce-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; border-radius: 12px;
    margin-bottom: 14px; font-size: .84rem; flex-wrap: wrap;
}
.announce-bar.announce-liturgy {
    background: linear-gradient(135deg, rgba(61,32,102,.07), rgba(107,70,150,.04));
    border: 1px solid rgba(107,70,150,.18);
    color: var(--purple-dark);
}
.announce-bar.announce-season {
    background: linear-gradient(135deg, rgba(200,150,60,.08), rgba(200,150,60,.03));
    border: 1px solid rgba(200,150,60,.22);
    color: #7c5000;
}
.announce-icon { font-size: 1.1rem; flex-shrink: 0; }
.announce-text { flex: 1; font-weight: 500; min-width: 200px; }
.announce-action {
    padding: 5px 13px; border-radius: 8px;
    background: var(--purple-gradient); color: #fff;
    font-size: .78rem; font-weight: 700; border: none; cursor: pointer;
    box-shadow: 0 2px 8px rgba(61,32,102,.2); transition: all .18s; white-space: nowrap;
}
.announce-action:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(61,32,102,.28); }
.announce-close {
    width: 24px; height: 24px; border-radius: 6px; border: none;
    background: rgba(107,70,150,.08); color: var(--text-muted);
    cursor: pointer; font-size: .85rem; flex-shrink: 0; transition: all .15s;
    display: flex; align-items: center; justify-content: center; padding: 0;
}
.announce-close:hover { background: rgba(239,68,68,.1); color: #ef4444; }

/* ===================================================
   SEARCH PAGE — Beautiful Action Buttons
   =================================================== */
/* Override plain action-btn in search context */
.search-advanced-bar .action-btn,
.search-advanced-bar .search-action-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 14px 20px !important;
    border-radius: 12px !important;
    font-size: .92rem !important;
    font-weight: 700 !important;
    white-space: nowrap;
    transition: all .2s !important;
}
.search-advanced-bar .action-btn.primary {
    background: var(--purple-gradient) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 16px rgba(61,32,102,.28) !important;
}
.search-advanced-bar .action-btn.primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(61,32,102,.38) !important;
}
.search-advanced-bar .action-btn:not(.primary) {
    background: rgba(255,255,255,.9) !important;
    border: 1.5px solid rgba(107,70,150,.18) !important;
    color: var(--purple-dark) !important;
}
.search-advanced-bar .action-btn:not(.primary):hover {
    border-color: var(--purple) !important;
    background: rgba(107,70,150,.06) !important;
    transform: translateY(-1px) !important;
}

/* Search input fullwidth */
.search-advanced-bar { flex-wrap: nowrap !important; gap: 10px !important; }
.search-advanced-bar .search-input-wrapper {
    flex: 1 !important;
    min-width: 0 !important;
}
.search-advanced-bar .search-input {
    border-radius: 12px !important;
    border: 2px solid rgba(107,70,150,.15) !important;
    transition: border-color .2s, box-shadow .2s !important;
}
.search-advanced-bar .search-input:focus {
    border-color: var(--purple) !important;
    box-shadow: 0 0 0 4px rgba(107,70,150,.1) !important;
}

/* ===================================================
   COMPOSER FILTER ROW
   =================================================== */
.search-composer-wrap {
    margin: 12px 0;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(61,32,102,.04), rgba(200,150,60,.02));
    border: 1px solid rgba(107,70,150,.12);
    border-radius: 12px;
}
.search-composer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.search-composer-badge {
    font-size: .8rem;
    font-weight: 800;
    color: var(--purple-dark);
    white-space: nowrap;
    flex-shrink: 0;
}
.search-composer-select {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    padding: 9px 14px !important;
    border-radius: 10px !important;
    border: 1.5px solid rgba(107,70,150,.18) !important;
    font-weight: 600 !important;
    color: var(--purple-dark) !important;
    background: #fff !important;
    cursor: pointer;
    transition: border-color .15s !important;
}
.search-composer-select:focus {
    border-color: var(--purple) !important;
    box-shadow: 0 0 0 3px rgba(107,70,150,.1) !important;
    outline: none !important;
}

/* ===================================================
   COMPOSER INDEX BANNER (Top Authors)
   =================================================== */
.composer-index-banner {
    padding: 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(61,32,102,.05), rgba(200,150,60,.03));
    border: 1px solid rgba(107,70,150,.12);
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(61,32,102,.06);
}
.composer-index-header {
    font-size: .82rem;
    font-weight: 800;
    color: var(--purple-dark);
    margin-bottom: 10px;
    letter-spacing: .03em;
}
.composer-index-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.composer-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 99px;
    border: 1.5px solid rgba(107,70,150,.15);
    background: rgba(255,255,255,.95);
    cursor: pointer;
    transition: all .18s;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: 0 1px 4px rgba(61,32,102,.06);
}
.composer-chip:hover {
    border-color: var(--purple);
    color: var(--purple-dark);
    background: rgba(107,70,150,.06);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(61,32,102,.12);
}
.composer-chip-name {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.composer-chip-count {
    background: var(--purple-gradient);
    color: #fff;
    font-size: .62rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 99px;
    letter-spacing: .03em;
    flex-shrink: 0;
}
.composer-chip-all {
    background: linear-gradient(135deg, rgba(107,70,150,.08), rgba(61,32,102,.05));
    border-color: rgba(107,70,150,.2);
    color: var(--purple);
    font-weight: 700;
    font-size: .78rem;
}
.composer-chip-all:hover {
    background: var(--purple-gradient);
    color: #fff;
    border-color: transparent;
}

/* Dashboard search input beautify */
#dashboard-search {
    border-radius: 12px !important;
    border: 2px solid rgba(255,255,255,.2) !important;
    transition: all .2s !important;
}
#dashboard-search:focus {
    border-color: rgba(255,255,255,.5) !important;
    box-shadow: 0 0 0 4px rgba(255,255,255,.1) !important;
}

/* ===================================================
   SEARCH RESULT CARDS (sr-*) — Performance UI
   =================================================== */
.sr-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sr-song-card {
    display: flex;
    align-items: center;
    background: var(--card-bg, #fff);
    border: 1px solid rgba(107,70,150,.1);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .18s, transform .18s, border-color .18s;
    box-shadow: 0 1px 4px rgba(61,32,102,.05);
}
.sr-song-card:hover {
    box-shadow: 0 4px 16px rgba(61,32,102,.13);
    transform: translateY(-1px);
    border-color: rgba(107,70,150,.22);
}

.sr-card-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 0;
    cursor: pointer;
    padding: 12px 14px 12px 0;
}
.sr-cat-stripe {
    width: 4px;
    min-height: 46px;
    flex-shrink: 0;
    border-radius: 0 3px 3px 0;
    margin-right: 12px;
    align-self: stretch;
}
.sr-card-info {
    flex: 1;
    min-width: 0;
}
.sr-card-title {
    font-size: .92rem;
    font-weight: 700;
    color: var(--text-primary, #2d1b4e);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.sr-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    flex-wrap: wrap;
}
.sr-meta-composer,
.sr-meta-cat,
.sr-meta-ref {
    font-size: .75rem;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}
.sr-meta-cat { font-weight: 700; }

.sr-card-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    flex-shrink: 0;
}

/* Action buttons inside sr-cards */
.sr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 700;
    padding: 5px 10px;
    transition: all .15s;
    text-decoration: none;
    line-height: 1;
}
.sr-btn-fav {
    background: rgba(107,70,150,.07);
    color: var(--text-muted, #6b7280);
    font-size: 1rem;
    padding: 5px 8px;
}
.sr-btn-fav:hover, .sr-btn-fav.starred {
    background: rgba(239,68,68,.1);
    color: #ef4444;
}
.sr-btn-fav.starred { color: #f59e0b; background: rgba(245,158,11,.1); }
.sr-btn-pdf {
    background: rgba(34,197,94,.1);
    color: #16a34a;
    border: 1px solid rgba(34,197,94,.2);
}
.sr-btn-pdf:hover {
    background: rgba(34,197,94,.2);
    transform: translateY(-1px);
}
.sr-btn-share {
    background: rgba(107,70,150,.07);
    color: var(--text-muted, #9ca3af);
}
.sr-btn-share:hover {
    background: rgba(107,70,150,.15);
    color: var(--purple, #6b4696);
}

/* Load more */
.sr-loadmore {
    text-align: center;
    padding: 16px 0 8px;
}
.sr-loadmore-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 28px;
    border: 2px solid rgba(107,70,150,.2);
    border-radius: 99px;
    background: rgba(107,70,150,.04);
    color: var(--purple, #6b4696);
    font-weight: 700;
    font-size: .88rem;
    cursor: pointer;
    transition: all .18s;
}
.sr-loadmore-btn:hover {
    border-color: var(--purple, #6b4696);
    background: rgba(107,70,150,.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107,70,150,.15);
}
.sr-loadmore-btn span {
    font-size: .78rem;
    color: var(--text-muted, #9ca3af);
    font-weight: 500;
}
.sr-end-note {
    text-align: center;
    padding: 12px;
    font-size: .78rem;
    color: var(--text-muted, #9ca3af);
    font-weight: 600;
}

/* Skeleton loader */
.sr-skeleton-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 0;
}
.sr-skeleton {
    height: 62px;
    border-radius: 12px;
    background: linear-gradient(90deg,
        rgba(107,70,150,.06) 25%,
        rgba(107,70,150,.12) 50%,
        rgba(107,70,150,.06) 75%);
    background-size: 200% 100%;
    animation: sr-shimmer 1.4s infinite;
}
@keyframes sr-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
