/* ai.rs — Domain-specific Styles */

/* ── Beginner section contrast fix (bg-green/20 tints the background) ── */
#beginner .text-muted { color: #97a6ba; }

/* ── Reserve space for JS-populated section grids (prevents CLS) ── */
#businessGrid,
#beginnerGrid,
#devArticlesGrid { min-height: 320px; }

/* ── Scroll offset for fixed navbar (h-16 = 64px + 16px breathing room) ── */
#business, #beginner, #developer { scroll-margin-top: 80px; }

/* ── Hero Gradient ── */
.hero-gradient {
    background:
        radial-gradient(ellipse 80% 60% at 70% 20%, rgba(56, 189, 248, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
}

/* ── Text Gradient ── */
.text-gradient {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Inline Article CTA ── */
.newsletter-cta-inner {
    padding: 2rem;
    background: #1e293b;
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-left: 3px solid #38bdf8;
    border-radius: 1rem;
    text-align: center;
}
.newsletter-cta-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: #4ade80;
}
.newsletter-cta-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
    color: #38bdf8;
}
.newsletter-cta-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 0.5rem;
}
.newsletter-cta-desc {
    font-size: 0.9375rem;
    color: #94a3b8;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}
.newsletter-cta-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.newsletter-cta-input {
    padding: 0.625rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.625rem;
    color: #f8fafc;
    font-size: 0.875rem;
    outline: none;
    width: 240px;
    transition: border-color 0.15s;
}
.newsletter-cta-input::placeholder { color: #8494a7; }
.newsletter-cta-input:focus { border-color: rgba(56, 189, 248, 0.5); }
.newsletter-cta-btn {
    padding: 0.625rem 1.5rem;
    background: #38bdf8;
    color: #0f172a;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.newsletter-cta-btn:hover { background: #0ea5e9; }
.newsletter-cta-note {
    font-size: 0.75rem;
    color: #8494a7;
}

@media (max-width: 640px) {
    .newsletter-cta-inner { padding: 1.5rem 1rem; }
    .newsletter-cta-input { width: 100%; }
    .newsletter-cta-form { flex-direction: column; }
    .newsletter-cta-btn { width: 100%; }
}

/* ── Content Upgrade Box ── */
.content-upgrade-inner {
    padding: 1.5rem;
    background: rgba(56, 189, 248, 0.04);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 1rem;
}
.content-upgrade-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 1rem;
}
.content-upgrade-title svg { color: #38bdf8; flex-shrink: 0; }
.content-upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.content-upgrade-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.625rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.3);
    text-decoration: none;
    transition: all 0.15s;
    text-align: left;
    font-size: 0.875rem;
    width: 100%;
    cursor: pointer;
}
.content-upgrade-item svg { flex-shrink: 0; margin-top: 0.125rem; }
.content-upgrade-item strong {
    display: block;
    color: #e2e8f0;
    font-weight: 600;
    margin-bottom: 0.125rem;
}
.content-upgrade-desc {
    display: block;
    font-size: 0.8125rem;
    color: #8494a7;
}
.content-upgrade-link {
    color: #38bdf8;
}
.content-upgrade-link:hover {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.06);
}
.content-upgrade-gated {
    color: #94a3b8;
    font-family: inherit;
}
.content-upgrade-gated:hover {
    border-color: rgba(71, 85, 105, 0.6);
    background: rgba(30, 41, 59, 0.6);
}
.content-upgrade-gate {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}
.content-upgrade-gate-text {
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-bottom: 0.625rem;
}
.content-upgrade-gate-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .content-upgrade-gate-form { flex-direction: column; }
    .content-upgrade-gate-form .newsletter-cta-input { width: 100%; }
    .content-upgrade-gate-form .newsletter-cta-btn { width: 100%; }
}

/* ── GitHub Sign-in Button ── */
.github-signin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
}
.github-signin-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}
.github-signin-btn svg {
    flex-shrink: 0;
}
.newsletter-email-fallback,
.upgrade-email-fallback {
    color: #8494a7;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}
.newsletter-email-fallback:hover,
.upgrade-email-fallback:hover {
    color: #94a3b8;
}

/* ── Article Blur Gate (dev articles, non-authed) ── */
.article-blur-wrap {
    filter: blur(5px);
    -webkit-filter: blur(5px);
    user-select: none;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
    mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
    max-height: 200px;
    overflow: hidden;
}
.article-blur-gate {
    position: relative;
    margin-top: -3rem;
    padding: 0 1.5rem 2.5rem;
    text-align: center;
}
.article-blur-gate-inner {
    max-width: 28rem;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    background: #1e293b;
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.article-blur-gate-inner > svg {
    color: #38bdf8;
}
.article-blur-gate-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f8fafc;
}
.article-blur-gate-desc {
    font-size: 0.9375rem;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}
.article-blur-gate-note {
    font-size: 0.75rem;
    color: #8494a7;
    margin-top: 0.25rem;
}
.article-blur-email-fallback {
    color: #8494a7;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.15s;
}
.article-blur-email-fallback:hover {
    color: #94a3b8;
}
.article-blur-email-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

@media (max-width: 640px) {
    .article-blur-gate-inner { padding: 2rem 1.25rem; }
    .article-blur-email-form { flex-direction: column; }
    .article-blur-email-form .newsletter-cta-input { width: 100%; }
    .article-blur-email-form .newsletter-cta-btn { width: 100%; }
}

/* ── AI Readiness Assessment ── */

/* Progress bar */
.assess-progress {
    position: fixed;
    top: 64px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #a78bfa);
    z-index: 60;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 0 2px 2px 0;
}

/* Step container */
.assess-step {
    display: none;
    animation: assessSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.assess-step.active {
    display: block;
}
@keyframes assessSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Selectable cards */
.assess-card {
    padding: 1rem 1.25rem;
    background: #1e293b;
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-align: left;
    width: 100%;
}
.assess-card:hover {
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.06);
    transform: translateY(-2px);
}
.assess-card.selected {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3), 0 4px 20px rgba(56, 189, 248, 0.1);
}
.assess-card.selected::after {
    content: '';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #38bdf8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 24 24' stroke='%230f172a' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
}
.assess-card.faded {
    opacity: 0.5;
}

/* Multi-select card */
.assess-card.multi-selected {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.3), 0 4px 20px rgba(56, 189, 248, 0.1);
}
.assess-card.multi-selected::after {
    content: '';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #38bdf8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 24 24' stroke='%230f172a' stroke-width='3'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5 13l4 4L19 7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
}

/* Insight bubble */
.assess-insight {
    padding: 1rem 1.25rem;
    background: rgba(30, 41, 59, 0.6);
    border-left: 3px solid #38bdf8;
    border-radius: 0 0.75rem 0.75rem 0;
    color: #94a3b8;
    font-size: 0.9375rem;
    font-style: italic;
    line-height: 1.6;
    animation: fadeIn 0.4s ease-out;
}

/* Thinking dots */
.assess-dots {
    display: inline-flex;
    gap: 4px;
    padding: 0.75rem 1.25rem;
}
.assess-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #38bdf8;
    animation: assessDotBounce 1.2s ease-in-out infinite;
}
.assess-dots span:nth-child(2) { animation-delay: 0.15s; }
.assess-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes assessDotBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Autocomplete */
.assess-autocomplete {
    position: relative;
    width: 100%;
    max-width: 440px;
}
.assess-autocomplete input {
    width: 100%;
    padding: 0.875rem 1.125rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    color: #f8fafc;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s;
}
.assess-autocomplete input::placeholder { color: #8494a7; }
.assess-autocomplete input:focus { border-color: rgba(56, 189, 248, 0.5); }
.assess-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #1e293b;
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    max-height: 220px;
    overflow-y: auto;
    z-index: 20;
    scrollbar-width: thin;
    scrollbar-color: rgba(71, 85, 105, 0.5) transparent;
    display: none;
}
.assess-dropdown.open { display: block; }
.assess-dropdown-item {
    padding: 0.625rem 1rem;
    color: #cbd5e1;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.1s;
}
.assess-dropdown-item:first-child { border-radius: 0.75rem 0.75rem 0 0; }
.assess-dropdown-item:last-child { border-radius: 0 0 0.75rem 0.75rem; }
.assess-dropdown-item:hover,
.assess-dropdown-item.active {
    background: rgba(56, 189, 248, 0.1);
    color: #f8fafc;
}
.assess-dropdown-item.other-item {
    border-top: 1px solid rgba(71, 85, 105, 0.3);
    color: #8494a7;
    font-style: italic;
}
.assess-other-input {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.875rem 1.125rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.625rem;
    color: #f8fafc;
    font-size: 1rem;
    outline: none;
    animation: fadeIn 0.3s ease-out;
}
.assess-other-input::placeholder { color: #8494a7; }
.assess-other-input:focus { border-color: rgba(56, 189, 248, 0.5); }

/* Score display */
.assess-score {
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}
.assess-score-number {
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.assess-score-label {
    font-size: 1.5rem;
    color: #8494a7;
    font-weight: 600;
}
.assess-score-bar {
    width: 100%;
    max-width: 320px;
    height: 12px;
    background: rgba(71, 85, 105, 0.3);
    border-radius: 6px;
    margin: 1.5rem auto;
    overflow: hidden;
}
.assess-score-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #a78bfa);
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Result card */
.assess-result {
    background: #1e293b;
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 1rem;
    padding: 1.5rem;
    animation: fadeIn 0.4s ease-out;
}
.assess-result-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
}
.assess-result-item + .assess-result-item {
    border-top: 1px solid rgba(71, 85, 105, 0.2);
}

/* Lead form (email gate) */
.lead-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 440px;
    margin: 0 auto;
}
.lead-form input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: 0.75rem;
    color: #f8fafc;
    font-size: 0.9375rem;
    outline: none;
    transition: border-color 0.15s;
}
.lead-form input::placeholder { color: #8494a7; }
.lead-form input:focus { border-color: rgba(56, 189, 248, 0.5); }
.lead-form button {
    padding: 0.75rem 1.75rem;
    background: #38bdf8;
    color: #0f172a;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.lead-form button:hover { background: #0ea5e9; }

/* Mobile */
@media (max-width: 640px) {
    .assess-autocomplete { max-width: 100%; }
    .lead-form { flex-direction: column; }
    .lead-form input { min-width: 0; width: 100%; }
    .lead-form button { width: 100%; }
    .assess-score-number { font-size: 4rem; }
}

/* ── Partnership Button Glow ── */
.partnership-glow {
    animation: partnershipPulse 3s ease-in-out infinite;
}
.partnership-glow:hover {
    animation: none;
    box-shadow: 0 0 25px rgba(167, 139, 250, 0.45);
}
@keyframes partnershipPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(167, 139, 250, 0.15); }
    50% { box-shadow: 0 0 20px rgba(167, 139, 250, 0.35); }
}
