/* ===========================================
   Coverage Gap Components CSS
   Phase 1 Implementation - Model vs Web Coverage Gap

   Design system colors (hardcoded - no CSS variables):
   - Primary: #0d6efd
   - Primary Light: #e7f1ff
   - Surface Secondary: #f8f9fa
   - Text Muted: #6c757d
   - Border: #dee2e6
   - Hover Background: #e9ecef
   - Success: #28a745
   - Warning: #ffc107
   - Error: #dc3545
   =========================================== */

/* ===== MetaDataDisplay Component ===== */
.metadata-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
}

.metadata-card h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metadata-card h4 i {
    color: #0d6efd;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.metadata-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metadata-item .label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-weight: 500;
}

.metadata-item .value {
    font-size: 0.9375rem;
    color: #212529;
}

.version-badge {
    display: inline-flex;
    padding: 0.25rem 0.5rem;
    background: #e7f1ff;
    color: #0d6efd;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.875rem;
}

.dataflow-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #e7f1ff;
    color: #0d6efd;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.875rem;
}

/* ===== PackagesList Component ===== */
.packages-list {
    margin-top: 1rem;
}

.packages-list h6 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.packages-list h6 i {
    color: #6c757d;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.75rem;
}

.package-item {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 0.75rem;
    border: 1px solid #dee2e6;
}

.barcode-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.barcode-display i {
    color: #6c757d;
}

.barcode-value {
    font-size: 1rem;
    color: #212529;
}

.package-type {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #495057;
}

.packing-date {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.packing-date i {
    font-size: 0.75rem;
}

/* ===== DeterminationLimits Editor ===== */
.determination-limits-editor {
    position: relative;
}

.limits-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.limit-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 0.5rem;
    align-items: center;
}

.limit-row label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
}

.limit-inputs {
    display: flex;
    gap: 0.5rem;
}

.limits-display {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.limits-display:hover {
    background: #e9ecef;
}

.edit-hint {
    font-size: 0.75rem;
    color: #6c757d;
    margin-left: 0.5rem;
    font-style: italic;
}

/* ===== SamplingFeatureComplex Editor ===== */
.sampling-feature-complex-editor {
    position: relative;
}

.relationship-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-row label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
}

.relationship-display {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.relationship-display:hover {
    background: #e9ecef;
}

/* ===== Edit Actions (shared) ===== */
.edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-save, .btn-cancel {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-save {
    background: #0d6efd;
    color: white;
}

.btn-save:hover {
    background: #0b5ed7;
}

.btn-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-cancel {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.btn-cancel:hover {
    background: #e9ecef;
}

/* ===== Form Grid Layouts ===== */
.form-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-field > label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #495057;
}

/* ===== Form Sections ===== */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section h5 {
    margin: 0 0 1rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h5 i {
    color: #6c757d;
    font-size: 0.875rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.section-header i {
    color: #6c757d;
}

.section-header h5 {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #212529;
}

/* ===== Detail Panel Styles ===== */
.detail-panel {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border-radius: 0 0 6px 6px;
}

.row-detail {
    background: #f8f9fa;
}
/*
.row-detail td {
    padding: 0 !important;
}*/

/* ===== Info Section (for OnderzoekOverview) ===== */
.info-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.info-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.info-section h4 i {
    color: #0d6efd;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

/* ===== Not Implemented Placeholder ===== */
.not-implemented {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 0.875rem;
}

.not-implemented i {
    color: #856404;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .packages-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-2col,
    .form-grid-3col {
        grid-template-columns: 1fr;
    }

    .limit-row {
        grid-template-columns: 1fr;
    }

    .limit-inputs {
        flex-wrap: wrap;
    }
}

/* =============================================
   Phase 3 Components CSS
   Multi-Reference, Multi-URN, Characteristic,
   and Full Observation Editors
   ============================================= */

/* ===== EditableMultiReferenceSelector ===== */
.multi-reference-editor {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.selected-references-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-reference-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #e7f1ff;
    border: 1px solid #0d6efd;
    border-radius: 16px;
    font-size: 0.875rem;
}

.selected-reference-tag .reference-name {
    color: #0d6efd;
    font-weight: 500;
}

.remove-reference-btn {
    background: none;
    border: none;
    color: #0d6efd;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    font-size: 0.75rem;
}

.remove-reference-btn:hover {
    color: #0b5ed7;
}

.add-reference-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.references-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reference-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    font-size: 0.8125rem;
    color: #495057;
}

.no-references-message {
    padding: 0.5rem;
    color: #6c757d;
    font-style: italic;
    font-size: 0.875rem;
}

/* ===== EditableMultiUrnSelector ===== */
.multi-urn-editor {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.selected-urns-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-urn-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #e7f1ff;
    border: 1px solid #0d6efd;
    border-radius: 16px;
    font-size: 0.875rem;
}

.selected-urn-tag .urn-name {
    color: #0d6efd;
    font-weight: 500;
}

.remove-urn-btn {
    background: none;
    border: none;
    color: #0d6efd;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    font-size: 0.75rem;
}

.remove-urn-btn:hover {
    color: #0b5ed7;
}

.add-urn-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.urns-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.urn-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    font-size: 0.8125rem;
    color: #495057;
}

.no-urns-message {
    padding: 0.5rem;
    color: #6c757d;
    font-style: italic;
    font-size: 0.875rem;
}

.btn-add {
    padding: 0.5rem 0.75rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-add:hover {
    background: #218838;
}

.btn-add:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== EditableCharacteristic ===== */
.editable-characteristic {
    position: relative;
}

.characteristic-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.numeric-value-inputs {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.characteristic-display {
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 4px;
    transition: background 0.2s;
    border: 1px solid #dee2e6;
}

.characteristic-display:hover {
    background: #e9ecef;
}

.characteristic-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.characteristic-indicator {
    font-weight: 600;
    color: #212529;
}

.characteristic-result {
    color: #495057;
}

.characteristic-value {
    color: #495057;
    font-family: 'Courier New', monospace;
}

.characteristic-remarks {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.25rem;
}

.no-characteristic {
    color: #6c757d;
    font-style: italic;
}

/* ===== EditableFullObservation ===== */
.editable-full-observation {
    position: relative;
}

.observation-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.observation-display {
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 4px;
    transition: background 0.2s;
    border: 1px solid #dee2e6;
}

.observation-display:hover {
    background: #e9ecef;
}

.observation-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.observation-indicator,
.observation-result,
.observation-value,
.observation-time,
.observation-procedure {
    font-size: 0.875rem;
}

.observation-indicator strong,
.observation-result strong,
.observation-value strong,
.observation-time strong,
.observation-procedure strong {
    color: #495057;
    font-weight: 600;
    margin-right: 0.5rem;
}

.observation-remarks {
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 0.25rem;
}

.no-observation {
    color: #6c757d;
    font-style: italic;
}

.field-hint {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.25rem;
    font-style: italic;
}

/* ===== Phase 3 Responsive Adjustments ===== */
@media (max-width: 768px) {
    .add-reference-section,
    .add-urn-section {
        flex-direction: column;
    }

    .numeric-value-inputs {
        flex-direction: column;
        align-items: stretch;
    }
}

/* =============================================
   Phase 4 Components CSS
   Regulatory and Supporting Entity Display
   NotificationDisplay, DecisionDisplay,
   RemediationDisplay, RiskDisplay, etc.
   ============================================= */

/* ===== Common Section Styles ===== */
.description-section,
.remarks-section,
.response-section,
.validity-section,
.timing-section,
.cost-section,
.volume-section,
.mitigation-section,
.projects-section,
.location-section,
.project-section,
.file-section,
.depth-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.description-section h5,
.remarks-section h5,
.response-section h5,
.validity-section h5,
.timing-section h5,
.cost-section h5,
.volume-section h5,
.mitigation-section h5,
.projects-section h5,
.location-section h5,
.project-section h5,
.file-section h5,
.depth-section h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.description-text,
.remarks-text,
.mitigation-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #495057;
    margin: 0;
}

/* ===== NotificationDisplay ===== */
.response-content {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid #0d6efd;
}

.response-date {
    font-size: 0.875rem;
    color: #495057;
    margin-bottom: 0.5rem;
}

.response-text {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #212529;
    margin: 0.5rem 0;
}

.response-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.response-time i {
    color: #0d6efd;
}

/* ===== DecisionDisplay ===== */
.validity-grid,
.timing-grid,
.cost-grid,
.id-grid,
.depth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.validity-item,
.timing-item,
.cost-item,
.id-item,
.depth-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ===== EditableDepth Full-Width Design ===== */
.depth-editor-full {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.depth-grid-full {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.depth-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.depth-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.depth-input,
.depth-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.depth-input:focus,
.depth-select:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.depth-input.invalid,
.depth-select.invalid {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.depth-field-error {
    color: #dc3545;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.depth-actions-full {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid #dee2e6;
}

/* Responsive: stack on smaller screens */
@media (max-width: 600px) {
    .depth-grid-full {
        grid-template-columns: 1fr;
    }
}

.validity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.validity-badge.valid {
    background: #d4edda;
    color: #155724;
}

.validity-badge.invalid {
    background: #f8d7da;
    color: #721c24;
}

/* ===== RemediationDisplay ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.status-badge.in-progress {
    background: #fff3cd;
    color: #856404;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.cost-overrun {
    color: #dc3545;
    font-weight: 600;
}

.cost-underrun {
    color: #28a745;
    font-weight: 600;
}

.value-large {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

/* ===== RiskDisplay ===== */
.risk-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.875rem;
}

.risk-type-human {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
}

.risk-type-spreading {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

.risk-type-ecological {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #17a2b8;
}

.risk-type-unknown {
    background: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
}

/* ===== References Section ===== */
.references-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.references-section h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reference-group {
    margin-bottom: 0.75rem;
}

.reference-group:last-child {
    margin-bottom: 0;
}

.reference-group strong {
    display: block;
    font-size: 0.8125rem;
    color: #495057;
    margin-bottom: 0.5rem;
}

.references-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ===== DocumentDisplay ===== */
.document-title {
    font-weight: 600;
}

.file-path {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.file-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.875rem;
    word-break: break-all;
}

.file-link:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

.file-path-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #495057;
    font-size: 0.875rem;
    word-break: break-all;
}

.file-path-text i {
    color: #6c757d;
}

/* ===== DossierDisplay ===== */
.dossier-name {
    font-weight: 600;
}

.project-reference,
.location-reference {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* ===== FilterDisplay ===== */
.depth-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* ===== Common Utility Classes ===== */
.monospace-text {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.no-data {
    color: #6c757d;
    font-style: italic;
    font-size: 0.875rem;
}

.basic-info {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 0.75rem;
}

.basic-info p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.basic-info ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.basic-info li {
    font-size: 0.875rem;
    margin: 0.25rem 0;
}

.hint {
    color: #6c757d;
    font-style: italic;
    font-size: 0.8125rem;
    margin-top: 0.75rem;
}

/* ===== Phase 4 Responsive Adjustments ===== */
@media (max-width: 768px) {
    .validity-grid,
    .timing-grid,
    .cost-grid,
    .id-grid,
    .depth-grid {
        grid-template-columns: 1fr;
    }

    .file-link,
    .file-path-text {
        font-size: 0.8125rem;
    }
}
