/**
 * Content Layout, Accordions, and Structured Content
 */

/* 4️⃣ CONTENT LAYOUT */
.single-content-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: var(--space-10);
    padding: var(--space-10) 0;
    max-width: 100%;
}

/* Left Column - Accordion Content */
.single-content-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    min-width: 0;
}

/* Accordion Styles - Premium SaaS Polish */
.content-accordion {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all var(--transition-base);
}

.content-accordion:hover {
    border-color: rgba(168, 85, 247, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.content-accordion.open {
    border-color: var(--brand-primary);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.08);
}

.accordion-header {
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast);
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.accordion-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.accordion-header .section-icon {
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    opacity: 0.9;
}

.accordion-icon {
    color: var(--text-dim);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.5;
}

.content-accordion.open .accordion-icon {
    transform: rotate(180deg);
    color: var(--brand-primary);
    opacity: 1;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-accordion.open .accordion-content {
    max-height: none;
    /* Fallback for initial load */
}

.accordion-body {
    padding: 0 20px 20px;
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.accordion-body p {
    margin: 0 0 var(--space-4);
}

.accordion-body p:last-child {
    margin-bottom: 0;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.feature-list li svg {
    color: var(--accent-success);
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
}

/* Use Cases Grid */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.use-case-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.use-case-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.use-case-text {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-primary);
}

/* Pricing Table */
.pricing-table {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.pricing-row {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    align-items: center;
}

.pricing-row.highlighted {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
}

.pricing-plan {
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
}

.pricing-price {
    font-weight: var(--weight-bold);
    color: var(--accent-success);
}

.pricing-row.highlighted .pricing-price {
    color: var(--brand-primary);
}

.pricing-desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Pros & Cons Vertical */
.structured-pros-cons-vertical {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pros-box,
.cons-box {
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
}

.pros-box {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}

.cons-box {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

.pros-box strong {
    color: var(--accent-success);
}

.cons-box strong {
    color: var(--accent-error);
}

/* Audience List */
.audience-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.audience-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.audience-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.audience-info strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.audience-info p {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* Structured Content Engine Styles */
.structured-section {
    margin-bottom: var(--space-12);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--border-subtle);
}

.structured-section:last-child {
    border-bottom: none;
}

.structured-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.structured-section h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--brand-primary);
    border-radius: 2px;
}

.section-content {
    line-height: 1.7;
    color: var(--text-secondary);
}

.section-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: var(--space-6) 0;
    display: block;
    transition: var(--transition-base);
}

.section-content img:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.structured-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin-top: var(--space-4);
}

.pros-box,
.cons-box {
    padding: var(--space-6);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
}

.pros-box strong,
.cons-box strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.pros-box strong {
    color: #10b981;
}

.cons-box strong {
    color: #ef4444;
}

.pros-box ul,
.cons-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pros-box li,
.cons-box li {
    position: relative;
    padding-left: var(--space-6);
    margin-bottom: var(--space-3);
    font-size: 0.9375rem;
}

.pros-box li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: bold;
}

.cons-box li::before {
    content: '×';
    position: absolute;
    left: 0;
    color: #ef4444;
    font-weight: bold;
    font-size: 1.2rem;
    top: -2px;
}

.structured-faq .faq-item {
    background: var(--bg-surface);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    border: 1px solid var(--border-subtle);
}

.structured-faq .faq-item strong {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: var(--space-2);
}

.structured-faq .faq-item p {
    color: var(--text-secondary);
    margin-bottom: 0;
    font-size: 0.9375rem;
}

/* Premium Content Fallback (Empty Fields) */
.field-fallback-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin: 8px 0;
    transition: all 0.3s ease;
}

.field-fallback-container:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(168, 85, 247, 0.3);
}

.fallback-info-text {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: #94a3b8;
    font-weight: 500;
    line-height: 1.4;
}

.fallback-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    color: white !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.fallback-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
    filter: brightness(1.1);
}

/* Content Feedback Section — Premium Horizontal Layout */
.content-feedback-section {
    margin: 40px 0;
    padding: 20px 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    /* Pill shape for premium look */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    transition: all 0.3s ease;
}

[data-theme="light"] .content-feedback-section {
    background: #f8fafc;
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.feedback-question {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.feedback-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.feedback-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    /* Pill buttons */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .feedback-btn {
    background: #ffffff;
    border-color: #e2e8f0;
}

/* Like Button Polish */
.feedback-like:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: #10b981;
    color: #10b981;
    transform: translateY(-2px);
}

/* Dislike Button Polish */
.feedback-dislike:hover {
    background: rgba(244, 63, 94, 0.08);
    border-color: #f43f5e;
    color: #f43f5e;
    transform: translateY(-2px);
}

.feedback-btn svg {
    transition: transform 0.3s ease;
}

.feedback-btn:hover svg {
    transform: scale(1.1);
}

.feedback-thanks {
    font-size: 0.95rem;
    font-weight: 600;
    color: #10b981;
    margin: 20px 0 0;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .content-feedback-section {
        padding: 24px 20px;
        border-radius: 16px;
        /* Back to original rounded rectangle */
        flex-direction: column;
        /* Stack vertically */
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .feedback-question {
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.4;
        margin: 0;
        max-width: 100%;
    }

    .feedback-actions {
        flex-direction: row;
        /* Buttons side-by-side on mobile */
        gap: 12px;
        width: 100%;
        justify-content: center;
    }

    .feedback-btn {
        flex: 1;
        /* Equal width buttons */
        padding: 10px 12px;
        font-size: 0.85rem;
        border-radius: 12px;
        justify-content: center;
        min-width: 0;
    }
}

/* Video Containers */
.bfai-video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin: var(--space-6) 0;
}

.bfai-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.accordion-body .video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: var(--space-4) 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
}

.accordion-body .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* SEO Typography in Accordions */
.accordion-body h2 {
    font-size: 1.5rem;
    font-weight: var(--weight-bold);
    color: var(--text-primary);
    margin: var(--space-8) 0 var(--space-4);
    line-height: var(--leading-tight);
}

.accordion-body h3 {
    font-size: 1.25rem;
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    margin: var(--space-6) 0 var(--space-3);
    line-height: var(--leading-tight);
}

.accordion-body h4 {
    font-size: 1.1rem;
    font-weight: var(--weight-semibold);
    color: var(--text-primary);
    margin: var(--space-5) 0 var(--space-2);
    line-height: var(--leading-snug);
}

.accordion-body p {
    font-size: 1rem;
    line-height: 1.75;
    margin: 0 0 var(--space-4);
    color: var(--text-secondary);
}

.accordion-body a {
    color: var(--brand-primary);
    font-weight: var(--weight-semibold);
    text-decoration: underline;
    text-decoration-color: rgba(168, 85, 247, 0.3);
    text-underline-offset: 2px;
    transition: all var(--transition-fast);
}

.accordion-body a:hover {
    color: var(--brand-primary-light);
    text-decoration-color: var(--brand-primary);
}

.accordion-body ul,
.accordion-body ol {
    margin: 0 0 var(--space-4);
    padding-left: var(--space-6);
    line-height: 1.75;
}

.accordion-body li {
    margin-bottom: var(--space-2);
    color: var(--text-secondary);
}

/* ============================================
   RESPONSIVE TYPOGRAPHY (Mobile Audit)
   ============================================ */
@media (max-width: 768px) {

    /* Aggressive H2 reduction for SaaS-App Polish */
    .structured-section h2,
    .accordion-header h2,
    .accordion-body h2,
    h2[id^="toc-"] {
        font-size: 1.05rem;
        /* Precise 16.8px - Ultra Clean */
        letter-spacing: -0.015em;
        margin-top: var(--space-6);
        margin-bottom: var(--space-3);
    }

    .structured-section h2::before {
        height: 20px;
    }

    /* Reduce body font size for mobile */
    .section-content,
    .accordion-body p,
    .accordion-body li,
    .audience-info p,
    .pricing-desc,
    .faq-item p {
        font-size: 0.88rem;
        /* Reduced from 0.9375rem */
        line-height: 1.55;
    }

    .accordion-body {
        padding: 0 14px 16px;
        /* Reduced from 16px 20px */
    }

    .structured-section {
        margin-bottom: var(--space-8);
        padding-bottom: var(--space-6);
    }

    /* Adjust subheadings */
    .accordion-body h3 {
        font-size: 1.1rem;
    }

    .accordion-body h4 {
        font-size: 1rem;
    }

    /* Compact Grids for mobile */
    .use-cases-grid {
        gap: var(--space-3);
    }

    .use-case-item {
        padding: var(--space-3);
    }

    /* Fallback Container Mobile Optimization */
    .field-fallback-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        padding: 16px;
        border-radius: 12px;
        background: var(--bg-surface);
    }

    .fallback-info-text {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        font-size: 0.8125rem;
        color: var(--text-secondary);
        font-weight: 500;
        gap: 10px;
        line-height: 1.4;
    }

    .fallback-info-text span {
        max-width: 100%;
    }

    .fallback-info-text svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .fallback-action-btn {
        width: auto;
        min-width: 160px;
        justify-content: center;
        padding: 8px 20px;
        font-size: 0.8rem;
        border-radius: 8px;
    }
}