/* SLE Domain Therapy Tabs - Styles extracted from sle-domaenen-therapie.html */

/* Domain Tabs */
.domains-section {
    position: relative;
    z-index: 10;
    margin-bottom: 2rem;
}

.tabs-wrapper {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.tabs-header {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-bottom: 1px solid var(--border);
    background: var(--bg-tertiary);
}

.tabs-header::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 0 0 auto;
    padding: 0.75rem 0.875rem;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.tab-btn:hover {
    color: var(--primary);
    background: var(--bg-secondary);
}

.tab-btn.active {
    color: var(--primary);
    background: var(--bg-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.tab-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
}

.tab-btn.active .tab-number {
    background: var(--primary);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Domain Header */
.domain-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.domain-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.domain-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.domain-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Flowchart Container */
.flowchart-container {
    background: #ffffff;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    overflow-x: auto;
}

[data-theme="dark"] .flowchart-container {
    background: var(--bg-secondary);
}

.flowchart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-width: fit-content;
}

.flow-row {
    display: flex;
    align-items: stretch;
    /* Equal height for side-by-side boxes */
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Ensure flow-nodes in rows display as flex for vertical centering */
.flow-row>.flow-node {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Flow Nodes - Therapieessentials Color Scheme - Filled Style */
.flow-node {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    min-width: 140px;
    max-width: 200px;
    position: relative;
    transition: all 0.2s ease;
    cursor: default;
    /* Default: Azure filled with white text */
    background: #2d8bba;
    border: none;
    color: white;
}

.flow-node:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Dark mode: filled with same colors, dark text */
[data-theme="dark"] .flow-node {
    background: #38bdf8;
    border: none;
    color: #0f172a;
}

/* Base/Header nodes - Azure border, transparent, bold text */
.flow-node.base {
    background: transparent;
    border: 2px solid #2d8bba;
    color: #0f172a;
    font-weight: 700;
    font-size: 0.95rem;
}

[data-theme="dark"] .flow-node.base {
    background: transparent;
    border: 2px solid #38bdf8;
    color: #f1f5f9;
}

/* Standard nodes - uses default .flow-node styling, no additional rules needed */

/* Biologic nodes - Teal filled */
.flow-node.biologic {
    background: #0d9488;
    border: none;
    color: white;
}

[data-theme="dark"] .flow-node.biologic {
    background: #2dd4bf;
    border: none;
    color: #0f172a;
}

/* Rescue/Refractory nodes - Red matching drug-tag.rescue */
.flow-node.rescue {
    background: #ef4444;
    border: none;
    color: white;
}

[data-theme="dark"] .flow-node.rescue {
    background: #f87171;
    border: none;
    color: #0f172a;
}

/* Optional nodes - dashed border */
.flow-node.optional {
    background: #ffffff;
    border: 2px dashed #2d8bba;
    color: #64748b;
}

[data-theme="dark"] .flow-node.optional {
    background: #1e293b;
    border: 2px dashed #cbd5e1;
    color: #94a3b8;
}

/* cDMARD nodes - Orange filled */
.flow-node.cdmard {
    background: #f59e0b;
    border: none;
    color: white;
}

[data-theme="dark"] .flow-node.cdmard {
    background: #fbbf24;
    border: none;
    color: #0f172a;
}

/* Condition nodes */
.flow-node.condition {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    font-size: 0.8rem;
    color: #64748b;
    font-style: italic;
}

[data-theme="dark"] .flow-node.condition {
    background: #1e293b;
    border: 1px solid #475569;
    color: #94a3b8;
}

/* Flow Arrows - Therapieessentials color scheme */
.flow-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #2d8bba;
}

.flow-arrow-down {
    width: 2px;
    height: 30px;
    background: #2d8bba;
    position: relative;
}

.flow-arrow-down::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid #2d8bba;
}

[data-theme="dark"] .flow-arrow {
    color: #cbd5e1;
}

[data-theme="dark"] .flow-arrow-down {
    background: #cbd5e1;
}

[data-theme="dark"] .flow-arrow-down::after {
    border-top-color: #cbd5e1;
}

.flow-arrow-text {
    font-size: 0.85rem;
    font-weight: 500;
    color: #2d8bba;
    margin-top: 0.25rem;
}

[data-theme="dark"] .flow-arrow-text {
    color: #cbd5e1;
}

.flow-connector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* Branch Container - Flexbox (legacy) */
.flow-branch {
    display: flex;
    gap: 2rem;
    position: relative;
    padding-top: 1rem;
}

.flow-branch::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: #2d8bba;
}

[data-theme="dark"] .flow-branch::before {
    background: #cbd5e1;
}

/* Branch Container - CSS Grid (preferred for alignment) */
.flow-branch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 2rem;
    position: relative;
    padding-top: 1rem;
    width: 100%;
    max-width: 600px;
}

.flow-branch-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #2d8bba;
}

[data-theme="dark"] .flow-branch-grid::before {
    background: #cbd5e1;
}

.branch-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.branch-cell>.flow-node {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.branch-column {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    /* Equal width for boxes in column */
    gap: 0.75rem;
}

.branch-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    text-align: center;
    align-self: center;
}

/* Ensure flow-nodes in branch-columns display as flex for vertical centering */
.branch-column>.flow-node {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Severity Columns */
.severity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.severity-column {
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.severity-header {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.severity-header.mild {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.severity-header.moderate {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.severity-header.severe {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.severity-header.refractory {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #5b21b6;
}

[data-theme="dark"] .severity-header.mild {
    background: linear-gradient(135deg, #166534 0%, #15803d 100%);
    color: #bbf7d0;
}

[data-theme="dark"] .severity-header.moderate {
    background: linear-gradient(135deg, #92400e 0%, #b45309 100%);
    color: #fef3c7;
}

[data-theme="dark"] .severity-header.severe {
    background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
    color: #fee2e2;
}

[data-theme="dark"] .severity-header.refractory {
    background: linear-gradient(135deg, #5b21b6 0%, #6d28d9 100%);
    color: #ede9fe;
}

.severity-content {
    padding: 1.25rem;
}

.therapy-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.therapy-step:last-child {
    border-bottom: none;
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-drugs {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.step-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.drug-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: #2d8bba;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    color: white;
}

[data-theme="dark"] .drug-tag {
    background: #38bdf8;
    color: #0f172a;
}

.drug-tag.strong {
    background: #0d9488;
    color: white;
}

/* Biologics - Teal */
.drug-tag.biologic {
    background: #0d9488;
    color: white;
}

[data-theme="dark"] .drug-tag.biologic {
    background: #2dd4bf;
    color: #0f172a;
}

/* GC and CYC - Red */
.drug-tag.rescue {
    background: #ef4444;
    color: white;
}

[data-theme="dark"] .drug-tag.rescue {
    background: #f87171;
    color: #0f172a;
}

/* Key Messages Box */
.key-message-box {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
}

[data-theme="dark"] .key-message-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
    border-left-color: #fbbf24;
}

.key-message-title {
    font-weight: 700;
    color: #b45309;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[data-theme="dark"] .key-message-title {
    color: #fbbf24;
}

.key-message-text {
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Warning/Emergency Alert Card - Feed-style design */
.alert-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left: 4px solid #ef4444;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.alert-card::before {
    content: '⚠️';
    position: absolute;
    top: -0.75rem;
    left: 1rem;
    background: var(--bg-primary);
    padding: 0 0.5rem;
    font-size: 1.25rem;
}

.alert-card.emergency {
    border-left-color: #dc2626;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, var(--bg-primary) 100%);
}

[data-theme="dark"] .alert-card.emergency {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, var(--bg-primary) 100%);
    border-color: #991b1b;
    border-left-color: #ef4444;
}

.alert-card-title {
    font-weight: 700;
    font-size: 1rem;
    color: #dc2626;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[data-theme="dark"] .alert-card-title {
    color: #f87171;
}

.alert-card-text {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.alert-card-text strong {
    color: #dc2626;
}

[data-theme="dark"] .alert-card-text strong {
    color: #f87171;
}

/* Evidence Box */
.evidence-box {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-top: 1rem;
}

.evidence-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.evidence-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.evidence-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-primary);
    border-radius: 4px;
    font-size: 0.8rem;
}

.evidence-source {
    font-weight: 600;
    color: var(--secondary);
}

.evidence-level {
    color: var(--text-secondary);
}

/* Special Considerations */
.special-box {
    background: var(--bg-primary);
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-top: 1.5rem;
}

[data-theme="dark"] .special-box {
    border-color: #475569;
}

.special-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.special-list {
    list-style: none;
}

.special-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.special-list li:last-child {
    border-bottom: none;
}

.special-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 600;
}

/* Collapsible Special Box */
.special-box.collapsible {
    position: relative;
}

.special-box.collapsible .special-title {
    padding-right: 80px;
}

.special-box .expand-all-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.special-box .expand-all-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Collapsible list item */
.special-list li.collapsible-item {
    cursor: pointer;
}

.special-list li.collapsible-item::before {
    content: '▸';
    transition: transform 0.2s;
}

.special-list li.collapsible-item.expanded::before {
    content: '▾';
}

.special-list li.collapsible-item .item-header {
    display: block;
}

.special-list li.collapsible-item .item-detail {
    display: none;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.special-list li.collapsible-item.expanded .item-detail {
    display: block;
}

/* LN Special Link */
.ln-special-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--secondary) 0%, #4f46e5 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.ln-special-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.ln-link-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.ln-link-content p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.ln-link-arrow {
    font-size: 2rem;
    opacity: 0.8;
}

/* Content Footer for sources inside tabs */
.content-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 2rem;
    margin-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
}

.source-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.source-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.source-icon {
    font-size: 1.5rem;
}

.source-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.source-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .tab-btn .tab-text {
        display: none;
    }

    .domain-header {
        flex-direction: column;
        text-align: center;
    }

    /* Make flowchart elements smaller on mobile - no transform to avoid empty space */
    .flowchart-container {
        padding: 0.5rem;
    }

    .flowchart {
        gap: 0.5rem;
        width: 100%;
        min-width: auto !important;
    }

    .flow-node {
        min-width: auto !important;
        /* Override inline styles */
        width: auto;
        max-width: 120px;
        font-size: 0.7rem;
        padding: 0.5rem;
    }

    /* Larger width for single nodes that need more space */
    .flow-node.standard,
    .flow-node.base {
        max-width: 260px;
    }

    .flow-branch {
        gap: 0.25rem;
        width: 100%;
        justify-content: center;
    }

    .branch-column {
        gap: 0.4rem;
        flex: 1;
        /* Distribute space evenly */
        min-width: 0;
        /* Allow shrinking below content size */
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .branch-label {
        font-size: 0.6rem;
        padding: 0.15rem 0.4rem;
        white-space: nowrap;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .flow-arrow-down {
        height: 20px;
    }

    .flow-arrow-text {
        font-size: 0.6rem;
    }

    .flow-connector {
        font-size: 0.65rem;
    }

    .severity-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .tabs-header {
        display: none;
    }

    .tab-content {
        display: block !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Comparison Table - Wrapper with shadow (matching matrix style) */
.comparison-table-wrapper {
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}

[data-theme="dark"] .comparison-table-wrapper {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.comparison-table {
    border: none !important;
    border-radius: 8px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    border: none !important;
    padding: 0.75rem 1rem;
}

.comparison-table .comparison-header th:first-child {
    border-top-left-radius: 8px;
}

.comparison-table .comparison-header th:last-child {
    border-top-right-radius: 8px;
}

.comparison-table .comparison-header th {
    background: #0d9488 !important;
    color: white !important;
}

[data-theme="dark"] .comparison-table .comparison-header th {
    background: #2dd4bf !important;
    color: #0f172a !important;
}

/* Comparison table list styling with arrows */
.comparison-table ul {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.comparison-table ul li {
    padding: 0.25rem 0;
    padding-left: 1.2rem;
    position: relative;
    font-size: 0.85rem;
}

.comparison-table ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 600;
}

/* Fließtext - Blocksatz */
.article-content>p,
.article-content section>p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* ====================================
   Logo Day/Night Mode Visibility Toggle
   ==================================== */

/* Default: show light logo, hide dark logo */
.logo-light {
    display: block !important;
}

.logo-dark {
    display: none !important;
}

/* Dark mode: hide light logo, show dark logo */
[data-theme="dark"] .logo-light {
    display: none !important;
}

[data-theme="dark"] .logo-dark {
    display: block !important;
}