/* Data Coverage Modal Enhanced Styles */

/* Modal Container */
#data-coverage-modal .modal-content {
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
}

#data-coverage-modal h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    margin-bottom: 25px;
}

#data-coverage-modal h3 i {
    color: #ffffff;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.summary-card .card-icon {
    font-size: 2rem;
    color: #ffffff;
    opacity: 1;
}

.summary-card .card-content {
    flex: 1;
}

.summary-card .card-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #ffffff;
}

.summary-card .card-label {
    font-size: 0.9rem;
    color: #ffffff;
    opacity: 0.95;
}

/* Coverage Summary Section */
.coverage-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.coverage-summary h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.coverage-bar-container {
    background: #e9ecef;
    border-radius: 10px;
    height: 40px;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
}

#modal-coverage-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
}

#modal-coverage-percentage {
    color: #2c3e50;
    font-weight: bold;
    font-size: 1.1rem;
}

.coverage-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin-top: 10px;
}

.coverage-status.status-Excellent {
    background: #d4edda;
    color: #155724;
}

.coverage-status.status-Good {
    background: #cce5ff;
    color: #004085;
}

.coverage-status.status-Adequate {
    background: #fff3cd;
    color: #856404;
}

.coverage-status.status-Poor {
    background: #f8d7da;
    color: #721c24;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.category-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-card.excellent {
    border-left-color: #28a745;
}

.category-card.good {
    border-left-color: #667eea;
}

.category-card.adequate {
    border-left-color: #ffc107;
}

.category-card.poor {
    border-left-color: #dc3545;
}

.category-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.category-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.category-card.excellent .category-icon {
    background: #d4edda;
    color: #28a745;
}

.category-card.good .category-icon {
    background: #e7e9fc;
    color: #667eea;
}

.category-card.adequate .category-icon {
    background: #fff3cd;
    color: #ffc107;
}

.category-card.poor .category-icon {
    background: #f8d7da;
    color: #dc3545;
}

.category-title h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-top: 5px;
}

.status-badge.excellent {
    background: #d4edda;
    color: #155724;
}

.status-badge.good {
    background: #cce5ff;
    color: #004085;
}

.status-badge.adequate {
    background: #fff3cd;
    color: #856404;
}

.status-badge.poor {
    background: #f8d7da;
    color: #721c24;
}

/* Circular Progress Chart */
.coverage-circle {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.circle-bg {
    fill: none;
    stroke: #eee;
    stroke-width: 3;
}

.circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
}

.circular-chart.excellent .circle {
    stroke: #28a745;
}

.circular-chart.good .circle {
    stroke: #667eea;
}

.circular-chart.adequate .circle {
    stroke: #ffc107;
}

.circular-chart.poor .circle {
    stroke: #dc3545;
}

.circular-chart .percentage {
    fill: #2c3e50;
    font-size: 0.5em;
    text-anchor: middle;
    font-weight: bold;
}

@keyframes progress {
    0% {
        stroke-dasharray: 0 100;
    }
}

.category-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 15px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.missing-fields-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
}

.missing-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #856404;
    font-weight: 600;
    margin-bottom: 10px;
}

.missing-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.missing-field-chip {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 15px;
    padding: 4px 12px;
    font-size: 0.85rem;
    color: #495057;
    text-transform: capitalize;
}

.more-fields {
    background: #6c757d;
    color: white;
    border-radius: 15px;
    padding: 4px 12px;
    font-size: 0.85rem;
}

.category-complete {
    background: #d4edda;
    color: #155724;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Assessments Grid */
.assessments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.assessment-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.assessment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.assessment-card.ready {
    border-top: 3px solid #28a745;
}

.assessment-card.not-ready {
    border-top: 3px solid #dc3545;
}

.assessment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.assessment-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.assessment-icon.ready {
    background: #d4edda;
    color: #28a745;
}

.assessment-icon.not-ready {
    background: #f8d7da;
    color: #dc3545;
}

.ready-badge, .not-ready-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
}

.ready-badge {
    background: #d4edda;
    color: #155724;
}

.not-ready-badge {
    background: #f8d7da;
    color: #721c24;
}

.assessment-card-body {
    flex: 1;
}

.assessment-card-body h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.confidence-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 8px 12px;
    border-radius: 8px;
}

.confidence-indicator.confidence-high {
    background: #d4edda;
    color: #155724;
}

.confidence-indicator.confidence-medium {
    background: #fff3cd;
    color: #856404;
}

.confidence-indicator.confidence-low {
    background: #f8d7da;
    color: #721c24;
}

.confidence-label {
    font-weight: 600;
}

.confidence-value {
    text-transform: capitalize;
}

.progress-container {
    margin-bottom: 15px;
}

.progress-bar-wrapper {
    position: relative;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 5px;
}

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

.progress-fill.ready {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.progress-fill.not-ready {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.progress-label {
    font-size: 0.85rem;
    color: #6c757d;
}

.critical-missing {
    background: #fff3cd;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}

.critical-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #856404;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.critical-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.critical-field {
    background: white;
    border: 1px solid #ffc107;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 0.8rem;
    color: #856404;
    text-transform: capitalize;
}

.assessment-card-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.run-assessment-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.run-assessment-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Missing Fields Section */
.missing-fields-grouped {
    margin-top: 20px;
}

.priority-group {
    margin-bottom: 25px;
}

.priority-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 600;
}

.priority-group.high-priority .priority-header {
    background: #f8d7da;
    color: #721c24;
}

.priority-group.medium-priority .priority-header {
    background: #fff3cd;
    color: #856404;
}

.priority-group.low-priority .priority-header {
    background: #cce5ff;
    color: #004085;
}

.fields-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.missing-field-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-left: 3px solid;
}

.missing-field-card.priority-high {
    border-left-color: #dc3545;
}

.missing-field-card.priority-medium {
    border-left-color: #ffc107;
}

.missing-field-card.priority-low {
    border-left-color: #17a2b8;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.field-name {
    font-weight: 600;
    color: #2c3e50;
    text-transform: capitalize;
}

.field-category {
    background: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
}

.field-impact {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.85rem;
}

.field-impact i {
    color: #dc3545;
}

/* Data Sources */
.sources-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.source-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.source-icon {
    width: 40px;
    height: 40px;
    background: #e7e9fc;
    color: #667eea;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.source-details {
    flex: 1;
}

.source-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.source-info {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #6c757d;
}

.fields-extracted {
    display: flex;
    align-items: center;
    gap: 5px;
}

.extraction-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* No Data Messages */
.no-sources {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

/* Modal Footer Actions */
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    margin-top: 30px;
}

#run-assessments-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#run-assessments-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

#run-assessments-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

#data-coverage-close-btn {
    padding: 12px 24px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

#data-coverage-close-btn:hover {
    background: #5a6268;
}

/* Responsive Design */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .assessments-grid {
        grid-template-columns: 1fr;
    }
    
    .fields-list {
        grid-template-columns: 1fr;
    }
    
    .sources-list {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-stats {
        flex-direction: column;
        gap: 10px;
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease;
}
