/* ============================================================================
   COLLAPSIBLE METHODOLOGY SECTIONS
   ============================================================================ */

/* Methodology Section Wrapper */
.methodology-section-wrapper {
    margin-bottom: 2rem;
}

/* Collapsible Header Styling */
.collapsible-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: none;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.3);
}

.collapsible-header:hover {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    box-shadow: 0 6px 16px rgba(30, 41, 59, 0.4);
    transform: translateY(-2px);
}

.collapsible-header[aria-expanded="false"] {
    border-radius: 12px;
    margin-bottom: 0;
}

.collapsible-header[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Section Header Content */
.section-header-content {
    flex: 1;
}

.section-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    font-size: 1.5rem;
    color: #93c5fd;
}

.section-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 1rem;
    color: #cbd5e1;
    font-weight: 400;
}

/* Toggle Icon */
.section-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.section-toggle i {
    font-size: 1.25rem;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.collapsible-header[aria-expanded="false"] .section-toggle i {
    transform: rotate(180deg);
}

.collapsible-header:hover .section-toggle {
    background: rgba(255, 255, 255, 0.3);
}

/* Collapsible Content */
.collapse {
    transition: height 0.35s ease;
}

.collapse.show {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.collapse:not(.show) {
    padding: 0;
}

/* Content Card Compatibility */
.methodology-section-wrapper .content-card {
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .collapsible-header {
        padding: 1rem 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.9rem;
    }
    
    .section-toggle {
        align-self: flex-end;
        margin-top: -2.5rem;
    }
    
    .collapse.show {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .collapsible-header {
        padding: 0.875rem 1rem;
    }
    
    .section-title {
        font-size: 1.25rem;
        gap: 0.5rem;
    }
    
    .section-title i {
        font-size: 1.25rem;
    }
    
    .section-subtitle {
        font-size: 0.85rem;
    }
    
    .section-toggle {
        width: 36px;
        height: 36px;
    }
    
    .section-toggle i {
        font-size: 1.1rem;
    }
    
    .collapse.show {
        padding: 1rem;
    }
}

/* Animation for smooth transitions */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.collapse.show {
    animation: slideDown 0.3s ease;
}

/* Print styles - expand all sections when printing */
@media print {
    .collapsible-header {
        border-radius: 12px 12px 0 0;
        border-bottom: 2px solid #e9ecef;
    }
    
    .section-toggle {
        display: none;
    }
    
    .collapse {
        display: block !important;
        height: auto !important;
        opacity: 1 !important;
    }
}

/* ============================================================================
   ENHANCED TEXT AND CONTENT LAYOUT
   ============================================================================ */

/* Headings within collapsible content */
.collapse h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.collapse h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #334155;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.collapse h5 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #475569;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.collapse h6 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #64748b;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* Paragraphs */
.collapse p {
    font-size: 1rem;
    line-height: 1.7;
    color: #475569;
    margin-bottom: 1rem;
}

.collapse p.lead {
    font-size: 1.15rem;
    font-weight: 400;
    color: #334155;
    margin-bottom: 1.5rem;
}

/* Lists */
.collapse ul,
.collapse ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.collapse li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #475569;
}

/* Info Boxes and Special Content */
.info-box,
.key-concept,
.explainer-box,
.intro-box {
    background: #f0f9ff;
    border-left: 4px solid #2563eb;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.example-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.warning-box,
.warnings-box {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
}

/* Step Cards and Numbers */
.step-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.step-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 1rem;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Framework Steps */
.framework-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.framework-step:hover {
    background: #f3f4f6;
}

.framework-step h5 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.framework-step p {
    margin-bottom: 0;
}

/* Calculation Step */
.calculation-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.step-content {
    flex: 1;
}

/* Application Sections */
.application-section {
    margin-bottom: 2.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.application-header {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-icon {
    font-size: 2rem;
}

.application-content {
    padding: 1.5rem;
}

/* Use Cases */
.use-case {
    background: #fafafa;
    border-left: 3px solid #2563eb;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 6px;
}

.use-case h6 {
    color: #2563eb;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.scenario,
.action,
.outcome {
    margin-bottom: 0.75rem;
}

.scenario strong {
    color: #dc2626;
}

.action strong {
    color: #2563eb;
}

.outcome strong {
    color: #059669;
}

/* Key Benefit */
.key-benefit {
    background: #ecfdf5;
    border-left: 4px solid #059669;
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
    border-radius: 6px;
    font-weight: 500;
}

/* Decision Framework */
.decision-framework {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.framework-steps {
    margin-top: 1.5rem;
}

/* TOC Styling */
.toc-beginner {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.toc-beginner ul {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

.toc-beginner li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
}

.toc-beginner li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #2563eb;
    font-weight: bold;
}

.toc-beginner a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.toc-beginner a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Tables */
.collapse table {
    margin: 1.5rem 0;
}

.collapse th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

/* Code Blocks */
.collapse pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.collapse code {
    background: #f1f5f9;
    color: #dc2626;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Equation Boxes */
.equation-box {
    background: #fefce8;
    border: 2px solid #fbbf24;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
}

/* Comparison Boxes */
.comparison-box {
    margin: 1.5rem 0;
}

.comparison-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
}

.success-card {
    border-color: #10b981;
    background: #f0fdf4;
}

.warning-card {
    border-color: #f59e0b;
    background: #fffbeb;
}

/* Responsive Typography */
@media (max-width: 768px) {
    .collapse h3 {
        font-size: 1.5rem;
    }
    
    .collapse h4 {
        font-size: 1.3rem;
    }
    
    .collapse p {
        font-size: 0.95rem;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
}