/*!
 * Birthday Wishes Pro — Frontend Styles
 * Scoped under .bwp-app / .bwp-wrap to avoid theme conflicts.
 * Mobile-first, sleek, retention-focused.
 */

/* ---------------------------------------------------------------- */
/* Wrapper & layout                                                  */
/* ---------------------------------------------------------------- */

.bwp-wrap{
    color: var(--bwp-text, #1f2937);
    padding: clamp(20px, 4vw, 48px) 0;
}
.bwp-container{
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 32px);
}

.bwp-breadcrumb{
    margin: 0 0 24px;
    font-size: 13px;
}
.bwp-breadcrumb ol{
    list-style: none;
    margin: 0; padding: 0;
    display: flex; flex-wrap: wrap;
    gap: 6px 10px;
    color: #6b7280;
}
.bwp-breadcrumb li + li::before{
    content: "›";
    margin-right: 10px;
    color: #9ca3af;
}
.bwp-breadcrumb a{
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dashed transparent;
    transition: border-color .15s ease;
}
.bwp-breadcrumb a:hover{ border-bottom-color: currentColor; }

.bwp-page-header{
    text-align: center;
    margin: 0 0 36px;
    padding: 28px 0;
    position: relative;
}
.bwp-page-title{
    font-size: clamp(28px, 4.5vw, 44px);
    line-height: 1.15;
    margin: 0 0 14px;
    font-weight: 800;
    letter-spacing: -.02em;
    background: linear-gradient(135deg, var(--bwp-c1, #7c3aed) 0%, var(--bwp-c2, #ec4899) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.bwp-page-intro{
    font-size: clamp(15px, 2vw, 18px);
    color: #6b7280;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---------------------------------------------------------------- */
/* App / grid                                                        */
/* ---------------------------------------------------------------- */

.bwp-app{
    position: relative;
}

.bwp-filters{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
    padding: 12px;
    background: rgba(0,0,0,.025);
    border-radius: 14px;
    align-items: center;
}
.bwp-filters-spacer{ flex: 1; }

.bwp-chip{
    -webkit-appearance: none;
    appearance: none;
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
    line-height: 1;
    white-space: nowrap;
}
.bwp-chip:hover{
    border-color: var(--bwp-c1, #7c3aed);
    color: var(--bwp-c1, #7c3aed);
    transform: translateY(-1px);
}
.bwp-chip.is-active{
    background: linear-gradient(135deg, var(--bwp-c1, #7c3aed) 0%, var(--bwp-c2, #ec4899) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 16px -6px rgba(124, 58, 237, .5);
}

.bwp-grid{
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}
@media (min-width: 640px){
    .bwp-grid{ grid-template-columns: repeat(2, 1fr); }
}
.bwp-app[data-columns="3"] .bwp-grid{
    @media (min-width: 960px){
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (min-width: 960px){
    .bwp-app[data-columns="3"] .bwp-grid{ grid-template-columns: repeat(3, 1fr); }
    .bwp-app[data-columns="4"] .bwp-grid{ grid-template-columns: repeat(4, 1fr); }
    .bwp-app[data-columns="2"] .bwp-grid{ grid-template-columns: repeat(2, 1fr); }
}
.bwp-grid-single{
    max-width: 640px;
    margin: 0 auto;
    grid-template-columns: 1fr !important;
}

/* ---------------------------------------------------------------- */
/* Card                                                              */
/* ---------------------------------------------------------------- */

.bwp-card{
    --card-pad: clamp(18px, 2.5vw, 24px);
    position: relative;
    background: #ffffff;
    border: 1px solid #eef0f4;
    border-radius: 18px;
    padding: var(--card-pad);
    box-shadow: 0 2px 4px -2px rgba(15, 23, 42, .04), 0 6px 24px -12px rgba(15, 23, 42, .08), inset 0 1px 0 rgba(255,255,255,0.8);
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    transition: transform .4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow .4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.bwp-card::before{
    content: "";
    position: absolute;
    inset: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bwp-c1, #7c3aed), var(--bwp-c2, #ec4899));
    opacity: 0;
    transition: opacity .25s ease;
}
.bwp-card:hover{
    transform: translateY(-3px);
    box-shadow: 0 4px 8px -4px rgba(15, 23, 42, .08), 0 12px 36px -8px rgba(15, 23, 42, .12);
    border-color: #e2e4ec;
}
.bwp-card:hover::before{ opacity: 1; }

.bwp-card.is-featured{
    background: linear-gradient(135deg, #fff 0%, #fef9ff 100%);
    border-color: #f0d9ff;
}
.bwp-badge{
    position: absolute;
    top: 12px; right: 12px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: .03em;
    text-transform: uppercase;
    box-shadow: 0 2px 8px -2px rgba(245, 158, 11, .5);
}

.bwp-card-tones{
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.bwp-card-tones li{
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--bwp-c1, #7c3aed);
    background: rgba(124, 58, 237, .08);
    padding: 4px 10px;
    border-radius: 6px;
}

.bwp-card-body{
    font-size: 16px;
    line-height: 1.65;
    color: #374151;
    flex: 1;
}
.bwp-card-body p{ margin: 0 0 12px; }
.bwp-card-body p:last-child{ margin-bottom: 0; }

/* ---------------------------------------------------------------- */
/* Card actions                                                      */
/* ---------------------------------------------------------------- */

.bwp-card-actions{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px dashed #eef0f4;
    margin-top: auto;
}

.bwp-btn{
    -webkit-appearance: none;
    appearance: none;
    background: #f4f5f9;
    border: 1px solid transparent;
    color: #4b5563;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .18s ease;
    line-height: 1;
}
.bwp-btn svg{ flex-shrink: 0; }
.bwp-btn:hover{
    background: #ebedf4;
    color: #1f2937;
    transform: translateY(-1px);
}

/* Toast Notification Styles */
.bwp-toast-container{
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}
.bwp-toast{
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.2), 0 8px 10px -6px rgba(0,0,0,0.1);
    animation: bwpToastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.bwp-toast.is-closing{
    opacity: 0;
    transform: translateY(20px);
}
@keyframes bwpToastIn{
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.bwp-fav{
    margin-left: auto;
    background: transparent;
    padding: 8px;
    color: #9ca3af;
}
.bwp-fav:hover{ color: #ef4444; background: rgba(239,68,68,.08); transform: translateY(-1px); }
.bwp-fav[aria-pressed="true"]{
    color: #ef4444;
    background: rgba(239,68,68,.1);
}
.bwp-fav[aria-pressed="true"] svg{ fill: currentColor; }

.bwp-share{
    position: relative;
}
.bwp-share-menu{
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: rgba(31, 41, 55, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 6px;
    min-width: 160px;
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, .35);
    z-index: 10;
    display: flex;
    flex-direction: column;
}
.bwp-share-menu[hidden]{ display: none; }
.bwp-share-menu a{
    color: #f3f4f6;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    transition: background .15s ease;
}
.bwp-share-menu a:hover{ background: rgba(255,255,255,.08); }

/* ---------------------------------------------------------------- */
/* Load more / random                                                */
/* ---------------------------------------------------------------- */

.bwp-load-more-wrap{
    margin: 32px 0 0;
    text-align: center;
}
.bwp-load-more, .bwp-random-again{
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(135deg, var(--bwp-c1, #7c3aed) 0%, var(--bwp-c2, #ec4899) 100%);
    color: #fff;
    border: 0;
    padding: 14px 32px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .22s ease;
    box-shadow: 0 8px 24px -8px rgba(124, 58, 237, .6);
}
.bwp-load-more:hover, .bwp-random-again:hover{
    transform: translateY(-2px);
    box-shadow: 0 12px 32px -8px rgba(124, 58, 237, .7);
}
.bwp-load-more:disabled, .bwp-random-again:disabled{
    opacity: .6; cursor: not-allowed; transform: none;
}

.bwp-empty{
    text-align: center;
    padding: 64px 20px;
    color: #9ca3af;
    font-size: 16px;
}

/* ---------------------------------------------------------------- */
/* Directory                                                         */
/* ---------------------------------------------------------------- */

.bwp-directory{
    --bwp-dir-cols: 4;
}
.bwp-dir-section{ margin: 0 0 40px; }
.bwp-dir-section h2{
    font-size: 22px;
    margin: 0 0 18px;
    font-weight: 700;
    letter-spacing: -.01em;
}
.bwp-dir-grid{
    list-style: none; margin: 0; padding: 0;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
}
@media (min-width: 640px){
    .bwp-dir-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px){
    .bwp-dir-grid{ grid-template-columns: repeat(var(--bwp-dir-cols, 4), 1fr); }
}
.bwp-dir-grid a{
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: #1f2937;
    transition: all .18s ease;
}
.bwp-dir-grid a:hover{
    border-color: var(--bwp-c1, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -10px rgba(124, 58, 237, .25);
}
.bwp-dir-grid span{ font-weight: 600; font-size: 14px; }
.bwp-dir-grid small{ color: #9ca3af; font-size: 12px; margin-top: 2px; }

/* ---------------------------------------------------------------- */
/* Related links                                                     */
/* ---------------------------------------------------------------- */

.bwp-related{
    margin: 56px 0 0;
    padding: 32px 0 0;
    border-top: 1px solid #eef0f4;
}
.bwp-related h2{
    font-size: 22px;
    margin: 0 0 20px;
    font-weight: 700;
    letter-spacing: -.01em;
}
.bwp-related-grid{
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
}
@media (min-width: 640px){
    .bwp-related-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px){
    .bwp-related-grid{ grid-template-columns: repeat(4, 1fr); }
}
.bwp-related-link{
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: #f9fafb;
    border-radius: 12px;
    text-decoration: none;
    color: #1f2937;
    transition: all .18s ease;
}
.bwp-related-link:hover{
    background: #fff;
    box-shadow: 0 8px 24px -10px rgba(15, 23, 42, .15);
    transform: translateY(-2px);
}
.bwp-related-link strong{ font-size: 14px; font-weight: 700; }
.bwp-related-link small{ color: var(--bwp-c1, #7c3aed); font-size: 12px; font-weight: 600; }

/* ---------------------------------------------------------------- */
/* Single wish template                                              */
/* ---------------------------------------------------------------- */

.bwp-single{
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 32px);
}
.bwp-single-title{
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.2;
    margin: 0 0 24px;
    font-weight: 800;
    letter-spacing: -.02em;
}
.bwp-single-body{
    font-size: 18px;
    line-height: 1.75;
    color: #374151;
    background: #fff;
    border-radius: 18px;
    padding: clamp(24px, 4vw, 40px);
    box-shadow: 0 2px 4px -2px rgba(15, 23, 42, .04), 0 12px 36px -12px rgba(15, 23, 42, .1);
    border: 1px solid #eef0f4;
}
.bwp-single-actions{
    margin: 24px 0 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ---------------------------------------------------------------- */
/* Dark mode honoring prefers-color-scheme                           */
/* ---------------------------------------------------------------- */

@media (prefers-color-scheme: dark){
    .bwp-wrap{ color: #e5e7eb; }
    .bwp-page-intro,
    .bwp-breadcrumb{ color: #9ca3af; }
    .bwp-card,
    .bwp-dir-grid a,
    .bwp-single-body{
        background: #1f2937;
        border-color: #374151;
        color: #e5e7eb;
    }
    .bwp-card-body,
    .bwp-single-body,
    .bwp-dir-grid a{ color: #e5e7eb; }
    .bwp-filters{ background: rgba(255,255,255,.03); }
    .bwp-chip{ background: #1f2937; color: #d1d5db; border-color: #374151; }
    .bwp-btn{ background: #374151; color: #d1d5db; }
    .bwp-btn:hover{ background: #4b5563; color: #fff; }
    .bwp-related{ border-color: #374151; }
    .bwp-related-link{ background: #1f2937; color: #e5e7eb; }
    .bwp-card-actions{ border-color: #374151; }
}

/* ---------------------------------------------------------------- */
/* Reduced motion respect                                            */
/* ---------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce){
    .bwp-card, .bwp-btn, .bwp-chip, .bwp-load-more, .bwp-random-again,
    .bwp-dir-grid a, .bwp-related-link{
        transition: none;
    }
    .bwp-card:hover, .bwp-btn:hover{ transform: none; }
}

/* ============================================================
   Archive landing page additions
   ============================================================ */

.bwp-app .bwp-hero {
    text-align: center;
    padding: clamp(2rem, 5vw, 4rem) 0 clamp(1.5rem, 3vw, 2.5rem);
}

.bwp-app .bwp-section {
    margin: clamp(2rem, 5vw, 3.5rem) 0;
}

.bwp-app .bwp-section-title {
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    font-weight: 700;
    margin: 0 0 .35rem;
    letter-spacing: -0.01em;
    color: var(--bwp-fg, #111);
}

.bwp-app .bwp-section-sub {
    margin: 0 0 1.25rem;
    color: var(--bwp-muted, #666);
    font-size: 1rem;
    max-width: 60ch;
}

.bwp-app .bwp-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .65rem;
}

.bwp-app .bwp-directory-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    background: var(--bwp-card-bg, #fff);
    border: 1px solid var(--bwp-border, rgba(0,0,0,.08));
    color: var(--bwp-fg, #111);
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.bwp-app .bwp-directory-card:hover,
.bwp-app .bwp-directory-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--bwp-accent, #e91e63);
    box-shadow: 0 6px 18px -8px rgba(233, 30, 99, .35);
    outline: none;
}

.bwp-app .bwp-directory-card-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bwp-app .bwp-directory-card-count {
    flex: 0 0 auto;
    font-size: .75rem;
    font-weight: 700;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: var(--bwp-accent-soft, rgba(233, 30, 99, .1));
    color: var(--bwp-accent, #e91e63);
}

@media (prefers-reduced-motion: reduce) {
    .bwp-app .bwp-directory-card { transition: none; }
    .bwp-app .bwp-directory-card:hover,
    .bwp-app .bwp-directory-card:focus-visible { transform: none; }
}
