/* Dynamic FAQ Builder Styles */

/* FAQ Container */
.dfb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Page Header and Content */
.dfb-page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.dfb-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.dfb-page-content {
    margin-bottom: 3rem;
    line-height: 1.7;
    color: #64748b;
    font-size: 1.1rem;
}

.dfb-page-content p {
    margin-bottom: 1rem;
}

.dfb-page-content p:last-child {
    margin-bottom: 0;
}

.dfb-page-content h1,
.dfb-page-content h2,
.dfb-page-content h3,
.dfb-page-content h4,
.dfb-page-content h5,
.dfb-page-content h6 {
    color: #334155;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.dfb-page-content h1 { font-size: 1.75rem; }
.dfb-page-content h2 { font-size: 1.5rem; }
.dfb-page-content h3 { font-size: 1.375rem; }
.dfb-page-content h4 { font-size: 1.25rem; }
.dfb-page-content h5 { font-size: 1.125rem; }
.dfb-page-content h6 { font-size: 1rem; }

.dfb-page-content a {
    color: #475569;
    text-decoration: underline;
    text-decoration-color: #cbd5e1;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.dfb-page-content a:hover {
    color: #334155;
    text-decoration-color: #94a3b8;
}

/* Navigation */
.dfb-navigation {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #f1f5f9;
    z-index: 100;
    padding: 1rem 0;
}

.dfb-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.dfb-nav-link {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    text-decoration: none;
    color: #64748b;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

.dfb-nav-link:hover {
    background-color: #f8fafc;
    color: #475569;
}

.dfb-nav-link.dfb-nav-active {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

/* FAQ Sections */
.dfb-section {
    margin-bottom: 2.5rem;
    scroll-margin-top: 220px;
}

.dfb-section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.dfb-section-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 1px;
    background-color: #94a3b8;
}

/* FAQ Items */
.dfb-faq-item {
    margin-bottom: 0.75rem;
    border: 1px solid #f1f5f9;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.dfb-faq-item:hover {
    border-color: #e2e8f0;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.dfb-faq-item.dfb-open {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

.dfb-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background-color: #fafbfc;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: #475569;
}

.dfb-question:hover {
    background-color: #f8fafc;
    color: #334155;
}

.dfb-question:focus {
    outline: 1px solid #cbd5e1;
    outline-offset: -1px;
}

.dfb-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.75rem;
}

.dfb-icon-closed::before {
    content: '+';
    font-size: 1.25rem;
    font-weight: 400;
    color: #94a3b8;
}

.dfb-icon-open::before {
    content: '−';
    font-size: 1.25rem;
    font-weight: 400;
    color: #64748b;
}

.dfb-answer {
    padding: 0 1.25rem;
    background-color: white;
    border-top: 1px solid #f1f5f9;
}

.dfb-answer-content {
    padding: 1.25rem 0;
}

/* WYSIWYG Content Styling */
.dfb-answer-content {
    /* Typography */
    font-size: 0.95rem;
    line-height: 1.6;
    color: #64748b;
}

/* Headings within WYSIWYG content */
.dfb-answer-content h1,
.dfb-answer-content h2,
.dfb-answer-content h3,
.dfb-answer-content h4,
.dfb-answer-content h5,
.dfb-answer-content h6 {
    color: #334155;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.dfb-answer-content h1 { font-size: 1.5rem; }
.dfb-answer-content h2 { font-size: 1.375rem; }
.dfb-answer-content h3 { font-size: 1.25rem; }
.dfb-answer-content h4 { font-size: 1.125rem; }
.dfb-answer-content h5 { font-size: 1rem; }
.dfb-answer-content h6 { font-size: 0.95rem; }

.dfb-answer-content h1:first-child,
.dfb-answer-content h2:first-child,
.dfb-answer-content h3:first-child,
.dfb-answer-content h4:first-child,
.dfb-answer-content h5:first-child,
.dfb-answer-content h6:first-child {
    margin-top: 0;
}

/* Paragraphs */
.dfb-answer-content p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.dfb-answer-content p:last-child {
    margin-bottom: 0;
}

/* Links */
.dfb-answer-content a {
    color: #475569;
    text-decoration: underline;
    text-decoration-color: #cbd5e1;
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}

.dfb-answer-content a:hover {
    color: #334155;
    text-decoration-color: #94a3b8;
}

.dfb-answer-content a:focus {
    outline: 2px solid #cbd5e1;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Lists - Bulletproof approach using ::before pseudo-elements */
.dfb-answer-content ul,
.dfb-answer-content ol {
    margin: 0.75rem 0;
    padding-left: 0;
    line-height: 1.6;
    list-style: none !important;
}

.dfb-answer-content ul ul,
.dfb-answer-content ol ol,
.dfb-answer-content ul ol,
.dfb-answer-content ol ul {
    margin: 0.5rem 0;
}

.dfb-answer-content li {
    margin-bottom: 0.25rem;
    line-height: 1.6;
    position: relative;
    padding-left: 1.5rem;
}

.dfb-answer-content li:last-child {
    margin-bottom: 0;
}

/* Unordered lists - bullets */
.dfb-answer-content ul > li::before {
    content: "•";
    color: #94a3b8;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

.dfb-answer-content ul ul > li::before {
    content: "◦";
}

.dfb-answer-content ul ul ul > li::before {
    content: "▪";
}

/* Ordered lists - numbers */
.dfb-answer-content ol {
    counter-reset: list-counter;
}

.dfb-answer-content ol > li {
    counter-increment: list-counter;
}

.dfb-answer-content ol > li::before {
    content: counter(list-counter) ".";
    color: #94a3b8;
    font-weight: 500;
    position: absolute;
    left: 0;
    top: 0;
    min-width: 1.5em;
}

/* Nested ordered lists */
.dfb-answer-content ol ol {
    counter-reset: list-counter;
}

.dfb-answer-content ol ol > li {
    counter-increment: list-counter;
}

.dfb-answer-content ol ol > li::before {
    content: counter(list-counter, lower-alpha) ".";
}

.dfb-answer-content ol ol ol {
    counter-reset: list-counter;
}

.dfb-answer-content ol ol ol > li {
    counter-increment: list-counter;
}

.dfb-answer-content ol ol ol > li::before {
    content: counter(list-counter, lower-roman) ".";
}

/* Definition lists */
.dfb-answer-content dl {
    margin: 0.75rem 0;
}

.dfb-answer-content dt {
    font-weight: 600;
    color: #334155;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.dfb-answer-content dd {
    margin-left: 1rem;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    border-left: 2px solid #e2e8f0;
}

/* Blockquotes */
.dfb-answer-content blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background-color: #f8fafc;
    border-left: 3px solid #cbd5e1;
    border-radius: 0 0.25rem 0.25rem 0;
    font-style: italic;
    color: #64748b;
}

.dfb-answer-content blockquote p {
    margin: 0;
}

.dfb-answer-content blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #94a3b8;
    font-style: normal;
}

/* Code and pre */
.dfb-answer-content code {
    background-color: #f1f5f9;
    color: #475569;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.dfb-answer-content pre {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    padding: 1rem;
    overflow-x: auto;
    margin: 0.75rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.dfb-answer-content pre code {
    background: none;
    padding: 0;
    color: #475569;
}

/* Tables */
.dfb-answer-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.875rem;
}

.dfb-answer-content th,
.dfb-answer-content td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.dfb-answer-content th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #334155;
}

.dfb-answer-content tr:hover {
    background-color: #fafbfc;
}

/* Images */
.dfb-answer-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
    margin: 0.75rem 0;
}

.dfb-answer-content figure {
    margin: 1rem 0;
    text-align: center;
}

.dfb-answer-content figcaption {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Horizontal rule */
.dfb-answer-content hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1.5rem 0;
}

/* Emphasis and strong */
.dfb-answer-content em {
    font-style: italic;
    color: #475569;
}

.dfb-answer-content strong {
    font-weight: 600;
    color: #334155;
}

/* Small text */
.dfb-answer-content small {
    font-size: 0.875rem;
    color: #94a3b8;
}

/* Mark/highlight */
.dfb-answer-content mark {
    background-color: #fef3c7;
    color: #92400e;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dfb-container {
        padding: 1rem 0.5rem;
    }
    
    .dfb-page-title {
        font-size: 2rem;
    }
    
    .dfb-page-content {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .dfb-nav-list {
        flex-direction: column;
        align-items: center;
    }
    
    .dfb-section-title {
        font-size: 1.5rem;
    }
    
    .dfb-question {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .dfb-answer {
        padding: 0 1rem;
    }
    
    .dfb-answer-content {
        padding: 1rem 0;
        font-size: 0.9rem;
    }
    
    /* Adjust WYSIWYG content for mobile */
    .dfb-answer-content h1 { font-size: 1.375rem; }
    .dfb-answer-content h2 { font-size: 1.25rem; }
    .dfb-answer-content h3 { font-size: 1.125rem; }
    .dfb-answer-content h4 { font-size: 1rem; }
    .dfb-answer-content h5 { font-size: 0.95rem; }
    .dfb-answer-content h6 { font-size: 0.9rem; }
    
    .dfb-answer-content ul,
    .dfb-answer-content ol {
        padding-left: 1.25rem;
    }
    
    .dfb-answer-content blockquote {
        padding: 0.5rem 0.75rem;
        margin: 0.75rem 0;
    }
    
    .dfb-answer-content pre {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
    
    .dfb-answer-content table {
        font-size: 0.8rem;
    }
    
    .dfb-answer-content th,
    .dfb-answer-content td {
        padding: 0.375rem 0.5rem;
    }
}

/* Print Styles */
@media print {
    .dfb-navigation {
        display: none;
    }
    
    .dfb-faq-item {
        break-inside: avoid;
        border: 1px solid #000;
    }
    
    .dfb-answer {
        display: block !important;
    }
    
    .dfb-icon {
        display: none;
    }
}

/* Accessibility */
.dfb-question:focus-visible {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .dfb-faq-item {
        border: 1px solid #000;
    }
    
    .dfb-question {
        background-color: #000;
        color: #fff;
    }
    
    .dfb-answer {
        background-color: #fff;
        color: #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .dfb-faq-item,
    .dfb-question,
    .dfb-icon,
    .dfb-nav-link {
        transition: none;
    }
    
    .dfb-answer {
        transition: none;
    }
} 