/**
 * Extended Compliance Sections Styles
 * Styles for Annex III, GPAI, Risk Management, Data Governance, Logging, Provider Obligations, and Post-Market Monitoring
 */

/* ============================================
   Common Extended Section Styles
   ============================================ */

.compliance-extended-section {
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.95));
    border: 1px solid rgba(75, 85, 99, 0.3);
    border-radius: 16px;
    padding: 0;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.compliance-extended-section:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.compliance-extended-section h3 {
    color: #f9fafb;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.compliance-extended-section h3 > span {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.compliance-extended-section h3 .collapse-arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.3s ease;
    margin-left: auto;
}

.compliance-extended-section.collapsed h3 .collapse-arrow {
    transform: rotate(-90deg);
}

.compliance-extended-section h3:hover {
    background: rgba(99, 102, 241, 0.1);
}

.compliance-extended-section h3:hover .collapse-arrow {
    color: rgba(255, 255, 255, 0.9);
}

.compliance-extended-section > div:first-of-type {
    padding: 0 2rem 2rem 2rem;
    max-height: 10000px;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.3s ease,
                padding 0.3s ease;
    overflow: hidden;
}

.compliance-extended-section.collapsed > div:first-of-type {
    max-height: 0;
    opacity: 0;
    padding: 0 2rem;
}

/* Section status checkmark for empty/no-issues sections */
.compliance-extended-section .section-status-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #10b981;
    margin-left: auto;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.compliance-extended-section.section-no-issues h3 {
    color: rgba(16, 185, 129, 0.9);
}

.compliance-extended-section.section-no-issues h3 .section-status-check svg {
    filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.5));
}

.compliance-extended-section h3 > span > svg {
    color: #818cf8;
}

.compliance-extended-section h4 {
    color: #d1d5db;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ============================================
   Annex III Classification
   ============================================ */

.classification-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.classification-badge {
    display: inline-flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.125rem;
    width: fit-content;
}

.classification-badge.high-risk {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
    border: 2px solid #ef4444;
    color: #fca5a5;
}

.classification-badge.low-risk {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
    border: 2px solid #10b981;
    color: #6ee7b7;
}

.classification-badge.not-assessed {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.2), rgba(75, 85, 99, 0.2));
    border: 2px solid #6b7280;
    color: #9ca3af;
}

.no-data-placeholder {
    padding: 2rem;
    text-align: center;
    background: rgba(31, 41, 55, 0.3);
    border-radius: 8px;
    border: 1px dashed rgba(107, 114, 128, 0.5);
}

.category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.category-badge {
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid #6366f1;
    border-radius: 8px;
    color: #c7d2fe;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: capitalize;
}

.classification-rationale {
    background: rgba(31, 41, 55, 0.5);
    padding: 1.25rem;
    border-radius: 10px;
    border-left: 4px solid #818cf8;
}

.classification-rationale p {
    color: #d1d5db;
    line-height: 1.6;
    margin: 0;
}

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

.keyword-tag {
    padding: 0.4rem 0.8rem;
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    color: #fbbf24;
    font-size: 0.8125rem;
    font-weight: 500;
}

/* ============================================
   GPAI Compliance
   ============================================ */

.gpai-content {
    display: grid;
    gap: 2rem;
}

.gpai-models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.gpai-model-card {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.gpai-model-card:hover {
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.model-header h5 {
    color: #f9fafb;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.model-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item {
    display: flex;
    gap: 0.5rem;
}

.detail-item .label {
    color: #9ca3af;
    font-weight: 500;
}

.detail-item .value {
    color: #e5e7eb;
    text-transform: capitalize;
}

.gpai-obligations {
    background: rgba(31, 41, 55, 0.4);
    padding: 1.5rem;
    border-radius: 10px;
}

.obligations-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.obligation-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.obligation-item:hover {
    background: rgba(17, 24, 39, 0.8);
}

.obligation-item.checked {
    border-left: 4px solid #10b981;
}

.obligation-item.unchecked {
    border-left: 4px solid #ef4444;
}

.obligation-item .checkbox {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.obligation-item .obligation-label {
    color: #d1d5db;
    font-weight: 500;
}

/* ============================================
   Risk Management
   ============================================ */

.risk-management-content {
    display: grid;
    gap: 2rem;
}

.risk-matrix-container {
    background: rgba(31, 41, 55, 0.4);
    padding: 1.5rem;
    border-radius: 10px;
}

.risk-matrix-container canvas {
    max-height: 400px;
}

.risk-register-container {
    background: rgba(31, 41, 55, 0.4);
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
}

.risk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.risk-table thead {
    background: rgba(17, 24, 39, 0.8);
}

.risk-table th {
    padding: 0.875rem;
    text-align: left;
    color: #9ca3af;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(75, 85, 99, 0.3);
}

.risk-table td {
    padding: 0.875rem;
    color: #d1d5db;
    border-bottom: 1px solid rgba(75, 85, 99, 0.2);
}

.risk-row {
    transition: background-color 0.2s ease;
}

.risk-row:hover {
    background: rgba(31, 41, 55, 0.6);
}

.risk-row.risk-critical {
    border-left: 4px solid #dc2626;
}

.risk-row.risk-high {
    border-left: 4px solid #f59e0b;
}

.risk-row.risk-medium {
    border-left: 4px solid #eab308;
}

.risk-row.risk-low {
    border-left: 4px solid #10b981;
}

.severity-badge,
.likelihood-badge,
.risk-score-badge,
.status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    display: inline-block;
}

.severity-badge.severity-critical {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    border: 1px solid #dc2626;
}

.severity-badge.severity-high {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid #f59e0b;
}

.severity-badge.severity-medium {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
    border: 1px solid #eab308;
}

.severity-badge.severity-low,
.severity-badge.severity-negligible {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid #10b981;
}

.likelihood-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
    border: 1px solid #6366f1;
}

.risk-score-badge.score-critical {
    background: rgba(220, 38, 38, 0.3);
    color: #fca5a5;
    border: 1px solid #dc2626;
    font-weight: 700;
}

.risk-score-badge.score-high {
    background: rgba(245, 158, 11, 0.3);
    color: #fcd34d;
    border: 1px solid #f59e0b;
}

.risk-score-badge.score-medium {
    background: rgba(234, 179, 8, 0.3);
    color: #fde047;
    border: 1px solid #eab308;
}

.risk-score-badge.score-low {
    background: rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
    border: 1px solid #10b981;
}

.status-badge.status-identified,
.status-badge.status-open {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid #ef4444;
}

.status-badge.status-in_assessment,
.status-badge.status-in_progress {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    border: 1px solid #f59e0b;
}

.status-badge.status-mitigated,
.status-badge.status-closed {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid #10b981;
}

/* ============================================
   Data Governance
   ============================================ */

.data-governance-content {
    display: grid;
    gap: 2rem;
}

.data-quality-metrics,
.bias-assessment,
.data-lineage {
    background: rgba(31, 41, 55, 0.4);
    padding: 1.5rem;
    border-radius: 10px;
}

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

.metric-item {
    background: rgba(17, 24, 39, 0.6);
    padding: 1rem;
    border-radius: 8px;
}

.metric-label {
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.metric-value {
    color: #f9fafb;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.metric-bar {
    width: 100%;
    height: 8px;
    background: rgba(75, 85, 99, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.metric-fill.good {
    background: linear-gradient(90deg, #10b981, #059669);
}

.metric-fill.medium {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.metric-fill.poor {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.bias-status {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.125rem;
    text-align: center;
    margin-bottom: 1rem;
}

.bias-status.bias-detected {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    color: #fca5a5;
}

.bias-status.no-bias {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid #10b981;
    color: #6ee7b7;
}

.bias-categories {
    color: #d1d5db;
    padding: 0.75rem;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 6px;
}

.lineage-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lineage-item {
    color: #d1d5db;
    padding: 0.75rem;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 6px;
}

.lineage-item strong {
    color: #9ca3af;
}

/* ============================================
   Logging Capability
   ============================================ */

.logging-content {
    background: rgba(31, 41, 55, 0.4);
    padding: 1.5rem;
    border-radius: 10px;
}

.logging-status {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.125rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.logging-status.enabled {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid #10b981;
    color: #6ee7b7;
}

.logging-status.disabled {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    color: #fca5a5;
}

.logging-detail {
    color: #d1d5db;
    padding: 0.875rem;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.logging-detail strong {
    color: #9ca3af;
}

.logging-detail .warning {
    color: #fbbf24;
    font-weight: 600;
    margin-left: 0.5rem;
}

.events-list {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0 0 0;
}

.events-list li {
    padding: 0.375rem 0.75rem;
    margin-top: 0.25rem;
    background: rgba(31, 41, 55, 0.4);
    border-radius: 4px;
    border-left: 3px solid #818cf8;
}

/* ============================================
   Provider Obligations
   ============================================ */

.provider-obligations-content {
    background: rgba(31, 41, 55, 0.4);
    padding: 1.5rem;
    border-radius: 10px;
}

/* ============================================
   Post-Market Monitoring
   ============================================ */

.post-market-content {
    display: grid;
    gap: 1.5rem;
}

.post-market-details {
    background: rgba(31, 41, 55, 0.4);
    padding: 1.5rem;
    border-radius: 10px;
}

.post-market-status {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.125rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.post-market-status.enabled {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid #10b981;
    color: #6ee7b7;
}

.post-market-status.disabled {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    color: #fca5a5;
}

.incidents-list {
    background: rgba(31, 41, 55, 0.4);
    padding: 1.5rem;
    border-radius: 10px;
}

.incidents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.incident-card {
    background: rgba(17, 24, 39, 0.6);
    border-radius: 10px;
    padding: 1.25rem;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.incident-card.severity-critical {
    border-left-color: #dc2626;
}

.incident-card.severity-high {
    border-left-color: #f59e0b;
}

.incident-card.severity-medium {
    border-left-color: #eab308;
}

.incident-card.severity-low {
    border-left-color: #10b981;
}

.incident-card:hover {
    background: rgba(17, 24, 39, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.incident-header h5 {
    color: #f9fafb;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.incident-body p {
    color: #d1d5db;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
}

.incident-meta {
    color: #9ca3af;
    font-size: 0.8125rem;
}

.no-incidents {
    color: #9ca3af;
    text-align: center;
    padding: 2rem;
    font-style: italic;
}

/* ============================================
   Article 15: Accuracy, Robustness, Cybersecurity
   ============================================ */

.article15-status {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.125rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.article15-status.compliant {
    background: rgba(16, 185, 129, 0.2);
    border: 2px solid #10b981;
    color: #6ee7b7;
}

.article15-status.non-compliant {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    color: #fca5a5;
}

.accuracy-content,
.robustness-content,
.cybersecurity-content {
    background: rgba(31, 41, 55, 0.4);
    padding: 1.5rem;
    border-radius: 10px;
}

.robustness-checklist,
.security-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checklist-item:hover {
    background: rgba(17, 24, 39, 0.8);
}

.checklist-item.checked {
    border-left: 4px solid #10b981;
}

.checklist-item.unchecked {
    border-left: 4px solid #6b7280;
}

.checklist-item .checkbox {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.checklist-item span:not(.checkbox) {
    color: #d1d5db;
    font-weight: 500;
}

.metrics-section,
.measures-section,
.frameworks-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(75, 85, 99, 0.3);
}

.measures-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.measures-list li {
    padding: 0.625rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 6px;
    border-left: 3px solid #818cf8;
    color: #d1d5db;
}

.frameworks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 0.75rem;
}

.framework-badge {
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid #6366f1;
    border-radius: 8px;
    color: #c7d2fe;
    font-size: 0.875rem;
    font-weight: 600;
}

.audit-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(17, 24, 39, 0.6);
    border-radius: 6px;
    color: #d1d5db;
    font-size: 0.875rem;
}

.audit-info strong {
    color: #9ca3af;
    margin-right: 0.5rem;
}

.detail-item {
    padding: 0.75rem;
    margin-top: 0.75rem;
}

.detail-item .success {
    color: #6ee7b7;
}

.detail-item .warning {
    color: #fbbf24;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .compliance-extended-section {
        padding: 1.25rem;
    }

    .gpai-models-grid,
    .metrics-grid,
    .incidents-grid {
        grid-template-columns: 1fr;
    }

    .risk-register-container {
        overflow-x: scroll;
    }

    .risk-table {
        font-size: 0.75rem;
    }

    .risk-table th,
    .risk-table td {
        padding: 0.5rem;
    }
}
