/**
 * WP-Gemini Automator Pro - Frontend Styles
 * TOC, FAQ, and content enhancement styles
 * 
 * @since 1.5.0
 */

/* ========================================
   Table of Contents
   ======================================== */
.wgap-toc {
    margin: 25px 0 30px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95em;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.wgap-toc:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wgap-toc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}

.wgap-toc-header strong {
    flex: 1;
    font-size: 1.1em;
    color: #1e293b;
}

.wgap-toc-icon {
    font-size: 1.2em;
}

.wgap-toc-toggle {
    transition: transform 0.3s ease;
    color: #94a3b8;
    font-size: 0.8em;
}

.wgap-toc-collapsed .wgap-toc-toggle {
    transform: rotate(-90deg);
}

.wgap-toc-collapsed .wgap-toc-list {
    display: none;
}

.wgap-toc-list {
    margin: 0;
    padding-left: 20px;
    counter-reset: toc-counter;
}

.wgap-toc-list>li {
    counter-increment: toc-counter;
    margin-bottom: 6px;
    list-style: none;
}

.wgap-toc-list>li::before {
    content: counter(toc-counter) ". ";
    font-weight: 600;
    color: #667eea;
}

.wgap-toc-list a {
    color: #334155;
    text-decoration: none;
    border-bottom: 1px dotted #cbd5e1;
    transition: all 0.2s ease;
}

.wgap-toc-list a:hover {
    color: #667eea;
    border-bottom-color: #667eea;
}

.wgap-toc-list ol {
    padding-left: 20px;
    margin-top: 4px;
}

.wgap-toc-list ol li {
    list-style-type: lower-alpha;
    margin-bottom: 3px;
    font-size: 0.93em;
    color: #64748b;
}

.wgap-toc-list ol li a {
    color: #64748b;
}

.wgap-toc-list ol li a:hover {
    color: #667eea;
}

/* ========================================
   FAQ Section
   ======================================== */
.wgap-faq-section {
    margin: 30px 0 !important;
    padding: 25px !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03), rgba(118, 75, 162, 0.03)) !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
}

.wgap-faq-section h2 {
    margin-top: 0 !important;
    color: #1f2937 !important;
    font-size: 1.4em !important;
}

.wgap-faq-item {
    margin-bottom: 15px !important;
    padding: 18px !important;
    background: #fff !important;
    border-radius: 8px !important;
    border-left: 3px solid #667eea !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.wgap-faq-item:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
}

.wgap-faq-item:last-child {
    margin-bottom: 0 !important;
}

.wgap-faq-item h3 {
    margin: 0 0 8px !important;
    font-size: 1.05em !important;
    color: #374151 !important;
}

.wgap-faq-item p {
    margin: 0 !important;
    color: #6b7280 !important;
    line-height: 1.6 !important;
}

/* ========================================
   Key Takeaways Enhancement
   ======================================== */
.wgap-key-takeaways {
    transition: all 0.2s ease;
}

.wgap-key-takeaways:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ========================================
   Scroll Behavior
   ======================================== */
html {
    scroll-behavior: smooth;
}

/* Target headings with IDs (scroll offset for fixed headers) */
h2[id],
h3[id] {
    scroll-margin-top: 80px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .wgap-toc {
        padding: 15px 18px;
        font-size: 0.9em;
    }

    .wgap-faq-section {
        padding: 18px !important;
    }

    .wgap-faq-item {
        padding: 14px !important;
    }
}