/**
 * SEO Conversion System Styles
 * All classes use gc- prefix to avoid namespace collisions
 * with page-specific prefixes (wom-, su-, tech-, etc.)
 */

/* =========== DETAIL TOGGLE BUTTON =========== */

.gc-detail-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: transparent;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.gc-detail-toggle:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #f0f7ff;
}

.gc-detail-toggle.gc-expanded {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.gc-detail-toggle .gc-chevron {
    display: inline-block;
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.gc-detail-toggle.gc-expanded .gc-chevron {
    transform: rotate(180deg);
}

/* =========== SAVE BUTTON (for authority/niche cards) =========== */

.gc-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: transparent;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.gc-save-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #f0f7ff;
}

.gc-save-btn.gc-saved {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #3b82f6;
}

.gc-save-btn .gc-save-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: all 0.2s ease;
}

.gc-save-btn.gc-saved .gc-save-icon {
    fill: #3b82f6;
    stroke: #3b82f6;
}

/* Action bar injected into cards */
.gc-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* =========== DETAIL PANEL =========== */

.gc-detail-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s ease,
                padding 0.3s ease;
    opacity: 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 12px;
    padding: 0 20px;
}

.gc-detail-panel.gc-panel-open {
    max-height: 2000px;
    opacity: 1;
    padding: 20px;
}

.gc-detail-panel h4 {
    margin: 0 0 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

/* =========== DETAIL HEADER (grant title + amount) =========== */

.gc-detail-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.gc-detail-header h4.gc-detail-title {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: normal;
    color: #1e293b;
}

.gc-detail-amount {
    font-size: 0.85rem;
    font-weight: 600;
    color: #059669;
}

/* =========== DETAIL SECTIONS =========== */

.gc-detail-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.gc-detail-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.gc-detail-section p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #334155;
}

/* Eligibility list */
.gc-eligibility-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gc-eligibility-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #334155;
}

.gc-eligibility-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #22c55e;
    font-weight: 700;
}

/* Deadline */
.gc-deadline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.gc-deadline--open { color: #16a34a; }
.gc-deadline--upcoming { color: #d97706; }
.gc-deadline--closed { color: #dc2626; }
.gc-deadline--ongoing { color: #2563eb; }

/* Difficulty dots */
.gc-difficulty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.gc-difficulty-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
}

.gc-difficulty-dot.gc-filled {
    background: #f59e0b;
}

.gc-difficulty-label {
    margin-left: 8px;
    font-size: 0.85rem;
    color: #64748b;
}

/* =========== LOCK TEASER (gated content) =========== */

.gc-lock-teaser {
    position: relative;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(248,250,252,0) 0%, rgba(248,250,252,1) 80%);
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
    overflow: hidden;
}

.gc-lock-teaser-content {
    filter: blur(3px);
    user-select: none;
    pointer-events: none;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

.gc-lock-teaser-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(248, 250, 252, 0.7);
}

.gc-lock-teaser-overlay .gc-lock-icon {
    width: 20px;
    height: 20px;
    color: #94a3b8;
}

.gc-lock-teaser-overlay a {
    font-size: 0.85rem;
    font-weight: 600;
    color: #3b82f6;
    text-decoration: none;
    cursor: pointer;
}

.gc-lock-teaser-overlay a:hover {
    text-decoration: underline;
}

/* =========== ACTION ROW =========== */

.gc-action-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.gc-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    border: none;
}

.gc-action-btn--primary {
    background: #3b82f6;
    color: #fff;
}

.gc-action-btn--primary:hover {
    background: #2563eb;
}

.gc-action-btn--secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.gc-action-btn--secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.gc-action-btn--outline {
    border: 1.5px solid var(--gc-accent, #2d6a4f);
    color: var(--gc-accent, #2d6a4f);
    background: transparent;
    text-decoration: none;
    font-weight: 600;
}

.gc-action-btn--outline:hover {
    background: var(--gc-accent, #2d6a4f);
    color: #fff;
}

.gc-action-btn--gated {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.gc-action-btn--gated:hover {
    background: #e2e8f0;
    color: #475569;
}

.gc-action-btn--link {
    background: transparent;
    color: #3b82f6;
    padding: 8px 0;
}

.gc-action-btn--link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* =========== SMART STICKY BAR =========== */

.gc-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1e293b;
    border-top: 2px solid #3b82f6;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
}

.gc-sticky-bar.gc-bar-visible {
    transform: translateY(0);
}

.gc-sticky-bar-inner {
    max-width: 900px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.gc-sticky-bar-text {
    flex: 1;
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
}

.gc-sticky-bar-text strong {
    color: #fff;
}

.gc-sticky-bar-cta {
    flex-shrink: 0;
    padding: 10px 20px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    text-decoration: none;
}

.gc-sticky-bar-cta:hover {
    background: #2563eb;
    color: #fff;
}

.gc-sticky-bar-dismiss {
    background: none;
    border: none;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
    transition: color 0.15s;
}

.gc-sticky-bar-dismiss:hover {
    color: #94a3b8;
}

/* =========== QUIZ WIDGET =========== */

.gc-quiz-widget {
    max-width: 680px;
    margin: 2rem auto;
    padding: 28px 32px;
    background: linear-gradient(135deg, #f0f7ff 0%, #f8fafc 100%);
    border: 1px solid #dbeafe;
    border-radius: 12px;
}

.gc-quiz-widget h3 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
}

.gc-quiz-widget .gc-quiz-subtitle {
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: #64748b;
}

.gc-quiz-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gc-quiz-step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gc-quiz-step label {
    min-width: 80px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

.gc-quiz-step select {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #1e293b;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.gc-quiz-step select:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.gc-quiz-submit {
    margin-top: 6px;
    padding: 12px 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    align-self: flex-start;
}

.gc-quiz-submit:hover {
    background: #2563eb;
}

.gc-quiz-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Quiz Results */
.gc-quiz-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dbeafe;
}

.gc-quiz-results-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
    color: #16a34a;
}

.gc-quiz-results-header .gc-check-icon {
    width: 20px;
    height: 20px;
    color: #16a34a;
}

.gc-quiz-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.gc-quiz-card:hover {
    border-color: #3b82f6;
}

.gc-quiz-card-info {
    flex: 1;
    min-width: 0;
}

.gc-quiz-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gc-quiz-card-amount {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
}

.gc-quiz-card-save {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.gc-quiz-card-save:hover {
    background: #e2e8f0;
}

.gc-quiz-card-save svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #64748b;
    stroke-width: 2;
}

.gc-quiz-card-save.gc-saved svg {
    fill: #3b82f6;
    stroke: #3b82f6;
}

.gc-quiz-cta {
    margin-top: 16px;
    padding: 16px;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    text-align: center;
}

.gc-quiz-cta p {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #475569;
}

.gc-quiz-cta .gc-quiz-cta-btn {
    display: inline-block;
    padding: 10px 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.gc-quiz-cta .gc-quiz-cta-btn:hover {
    background: #2563eb;
    color: #fff;
}

/* =========== LOADING SPINNER =========== */

.gc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #64748b;
    font-size: 0.9rem;
    gap: 8px;
}

.gc-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: gc-spin 0.6s linear infinite;
}

@keyframes gc-spin {
    to { transform: rotate(360deg); }
}

/* =========== DIRECTORY TABLE EXPANSION =========== */

.gc-dir-detail-row {
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gc-dir-detail-row.gc-dir-detail-open {
    opacity: 1;
}

.gc-dir-detail-cell {
    padding: 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #f8fafc;
}

.gc-dir-detail-inner {
    padding: 20px;
}

.gc-dir-detail-inner .gc-detail-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.gc-dir-detail-inner .gc-detail-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.gc-dir-detail-inner .gc-action-row {
    padding-top: 4px;
}

/* Highlight the expanded source row */
tr.gc-dir-expanded {
    background: #eff6ff !important;
}

tr.gc-dir-expanded .dir-program-name {
    color: #2563eb !important;
}

/* =========== DEADLINE ALERT CTA =========== */

.gc-deadline-cta {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 14px 16px;
}

.gc-deadline-cta h4 {
    color: #166534;
    margin: 0 0 6px;
    font-size: 0.9rem;
}

.gc-deadline-cta p {
    color: #374151;
    font-size: 0.85rem;
    margin: 0 0 10px;
    line-height: 1.5;
}

.gc-cta-signup-link {
    color: #166534;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    border-bottom: 1px solid #166534;
}

.gc-cta-signup-link:hover {
    color: #14532d;
}

/* =========== PREMIUM INTEL TEASER =========== */

.gc-premium-teaser {
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 14px;
}

.gc-premium-teaser-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #92400e;
    background: #fde68a;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
}

.gc-premium-teaser p {
    color: #78716c;
    font-size: 0.82rem;
    margin: 6px 0 0;
    line-height: 1.5;
}

.gc-premium-teaser a {
    color: #92400e;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid #d97706;
}

.gc-premium-teaser a:hover {
    color: #78350f;
}

/* =========== RESPONSIVE =========== */

@media (max-width: 640px) {
    .gc-detail-panel.gc-panel-open {
        padding: 16px;
    }

    .gc-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .gc-action-btn {
        justify-content: center;
        text-align: center;
    }

    .gc-sticky-bar-inner {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px;
    }

    .gc-sticky-bar-text {
        flex-basis: 100%;
        font-size: 0.85rem;
    }

    .gc-sticky-bar-cta {
        flex: 1;
        text-align: center;
    }

    /* Collapse sticky bar when detail panel is open (avoid viewport crowding) */
    body.gc-panel-active .gc-sticky-bar {
        transform: translateY(100%) !important;
    }

    /* Move toast above sticky bar */
    body.gc-sticky-visible .seo-toast {
        bottom: 80px;
    }

    /* Quiz widget responsive */
    .gc-quiz-widget {
        padding: 20px;
        margin: 1.5rem 16px;
    }

    .gc-quiz-step {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .gc-quiz-step label {
        min-width: unset;
    }

    .gc-quiz-submit {
        align-self: stretch;
        text-align: center;
    }

    .gc-quiz-card-title {
        white-space: normal;
    }

    .gc-card-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .gc-card-actions .gc-detail-toggle,
    .gc-card-actions .gc-save-btn {
        justify-content: center;
        width: 100%;
    }

    .gc-dir-detail-inner {
        max-width: calc(100vw - 50px);
        padding: 16px;
    }

    .gc-dir-detail-inner .gc-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .gc-dir-detail-inner .gc-action-btn {
        justify-content: center;
        text-align: center;
    }
}

/* =========== ACCESSIBILITY =========== */

.gc-detail-toggle:focus-visible,
.gc-save-btn:focus-visible,
.gc-action-btn:focus-visible,
.gc-sticky-bar-cta:focus-visible,
.gc-quiz-submit:focus-visible,
.gc-quiz-card-save:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* =========== PRINT =========== */

@media print {
    .gc-sticky-bar,
    .gc-card-actions,
    .gc-quiz-widget,
    .gc-action-row,
    .gc-dir-detail-row {
        display: none !important;
    }

    .gc-detail-panel.gc-panel-open {
        max-height: none;
        border: 1px solid #ccc;
    }
}
