/**
 * SEO Engagement Styles for GrantCompass
 * Bookmark buttons, CTAs, toasts, and mobile sticky bar
 * Works with existing CSS variables (--accent, --primary, etc.)
 */

/* =========== BOOKMARK BUTTON =========== */

.bookmark-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bookmark-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bookmark-btn:active {
    transform: scale(0.95);
}

.bookmark-btn .bookmark-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--primary, #1a365d);
    stroke-width: 2;
    transition: all 0.2s ease;
}

.bookmark-btn.saved .bookmark-icon {
    fill: var(--accent, #2563eb);
    stroke: var(--accent, #2563eb);
}

.bookmark-btn.saved {
    background: var(--accent-soft, #eff6ff);
}

/* Grant card needs position relative for bookmark button */
.grant-card {
    position: relative;
}

/* =========== MODAL BOOKMARK BUTTON =========== */

.modal-bookmark-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    margin-bottom: 16px;
    border: 2px solid var(--primary, #1a365d);
    background: transparent;
    color: var(--primary, #1a365d);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-bookmark-btn:hover {
    background: var(--primary, #1a365d);
    color: #fff;
}

.modal-bookmark-btn.saved {
    background: var(--accent, #2563eb);
    border-color: var(--accent, #2563eb);
    color: #fff;
}

.modal-bookmark-btn .bookmark-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.modal-bookmark-btn.saved .bookmark-icon {
    fill: currentColor;
}

/* =========== QUIZ CTA (SUBTLE) =========== */

.quiz-cta-subtle {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--accent-soft, #f0f9ff) 0%, rgba(255,255,255,0.8) 100%);
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.quiz-cta-subtle p {
    margin: 0 0 1rem;
    color: var(--primary, #1a365d);
    font-size: 1.1rem;
}

.btn-outline {
    display: inline-block;
    padding: 12px 24px;
    border: 2px solid var(--accent, #2563eb);
    color: var(--accent, #2563eb);
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: var(--accent, #2563eb);
    color: #fff;
}

/* =========== NAV LINK SUBTLE (SIGN IN) =========== */

.nav-link-subtle {
    color: var(--primary, #1a365d);
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.nav-link-subtle:hover {
    opacity: 1;
    text-decoration: underline;
}

/* =========== TOAST NOTIFICATIONS =========== */

.seo-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary, #1a365d);
    color: #fff;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    max-width: calc(100vw - 32px);
    text-align: center;
}

.seo-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.seo-toast a {
    color: var(--accent-light, #60a5fa);
    text-decoration: underline;
    font-weight: 600;
}

.seo-toast a:hover {
    color: #fff;
}

/* =========== MOBILE STICKY BAR =========== */

.sticky-bar {
    display: none;
}

@media (max-width: 768px) {
    .sticky-bar.mobile-only {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #fff;
        padding: 12px 16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    .sticky-bar .bookmark-count {
        font-size: 0.85rem;
        color: var(--primary, #1a365d);
        font-weight: 500;
    }

    .sticky-bar a {
        background: var(--accent, #2563eb);
        color: #fff;
        padding: 10px 20px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    /* Add padding to body to prevent content being hidden behind sticky bar */
    body.has-sticky-bar {
        padding-bottom: 70px;
    }

    /* Move toast above sticky bar on mobile */
    .seo-toast {
        bottom: 80px;
    }
}

/* =========== BOOKMARK ICON SVG =========== */

/*
Use this SVG inline in HTML:
<svg class="bookmark-icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
    <path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"/>
</svg>
*/

/* =========== ANIMATION HELPERS =========== */

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.bookmark-btn.just-saved {
    animation: pulse 0.3s ease;
}

/* =========== ACCESSIBILITY =========== */

.bookmark-btn:focus-visible,
.modal-bookmark-btn:focus-visible,
.btn-outline:focus-visible {
    outline: 2px solid var(--accent, #2563eb);
    outline-offset: 2px;
}

/* =========== PRINT STYLES =========== */

@media print {
    .bookmark-btn,
    .quiz-cta-subtle,
    .sticky-bar,
    .seo-toast,
    .nav-link-subtle {
        display: none !important;
    }
}
