/* Scoped CSS for constraint_analysis.html */

/* Use consistent table-actions styling */
.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5em;
    margin-bottom: 1.5em;
    position: relative;
}

/* Consistent button styling */
.icon-btn {
    margin: 0 0.25em;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3em 0.5em;
    border-radius: 6px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.icon-btn:focus,
.icon-btn:hover {
    background: #e0e0e0;
}

.save-all-btn {
    background: #199bd7;
    color: #fff;
    font-weight: 600;
    border: none;
    box-shadow: 0 2px 8px rgba(42, 140, 255, 0.08);
    padding: 0.5em 1.2em;
    border-radius: 8px;
    font-size: 1.08em;
    transition: background 0.2s, box-shadow 0.2s;
}

.save-all-btn:focus,
.save-all-btn:hover {
    background: #1976d2;
    box-shadow: 0 4px 16px rgba(42, 140, 255, 0.16);
}

.save-all-label {
    margin-left: 0.3em;
    font-size: 1.08em;
    letter-spacing: 0.01em;
}

/* Analysis container */
.analysis-container {
    margin-top: 1em;
}

/* Summary cards section */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5em;
    margin-bottom: 2em;
}

.summary-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    padding: 1.5em;
    display: flex;
    align-items: center;
    gap: 1em;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card-icon {
    font-size: 2.5em;
    width: 60px;
    text-align: center;
    opacity: 0.8;
}

.card-content h3 {
    margin: 0 0 0.5em 0;
    font-size: 1.1em;
    color: #2a3a4a;
    font-weight: 600;
}

.card-value {
    font-size: 1.4em;
    font-weight: 700;
    color: #199bd7;
}

/* Status indicators */
.status-sufficient {
    color: #28a745;
}

.status-insufficient {
    color: #dc3545;
}

.status-needs_ic {
    color: #ffc107;
}

.status-adequate {
    color: #28a745;
}

.status-no_coverage {
    color: #dc3545;
}

.status-insufficient_capacity {
    color: #fd7e14;
}

.status-tight {
    color: #ffc107;
}

.status-impossible {
    color: #dc3545;
}

.status-restrictive {
    color: #fd7e14;
}

/* Analysis sections */
.analysis-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 2em;
    overflow: hidden;
}

.analysis-section h2 {
    background: #e3f0fa;
    color: #23405c;
    margin: 0;
    padding: 1em 1.5em;
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-bottom: 2.5px solid #b3c7dd;
}

.analysis-content {
    padding: 1.5em;
}

/* Loading state */
.loading {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2em;
}

/* Tables within analysis sections */
.analysis-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1em 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.analysis-table th,
.analysis-table td {
    border-bottom: 1px solid #e0e0e0;
    padding: 0.75em 1em;
    text-align: left;
    font-size: 0.93rem;
}

.analysis-table th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.02em;
}

.analysis-table tr:last-child td {
    border-bottom: none;
}

.analysis-table tr:hover {
    background: #f5f7fa;
}

.analysis-table td.numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25em 0.75em;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge.sufficient,
.status-badge.adequate {
    background: #d4edda;
    color: #155724;
}

.status-badge.insufficient,
.status-badge.no_coverage,
.status-badge.impossible {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.needs_ic,
.status-badge.tight,
.status-badge.restrictive {
    background: #fff3cd;
    color: #856404;
}

.status-badge.insufficient_capacity {
    background: #ffeaa7;
    color: #6c5ce7;
}

/* Summary statistics */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1em;
    margin: 1em 0;
    padding: 1em;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: 700;
    color: #199bd7;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-top: 0.25em;
}

/* Currency formatting */
.currency {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.currency::before {
    content: '$';
    margin-right: 0.2em;
}

/* Percentage formatting */
.percentage {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.percentage::after {
    content: '%';
    margin-left: 0.1em;
}

/* RVU formatting */
.rvus {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Responsive design */
@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .table-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 1em;
    }

    .analysis-table th,
    .analysis-table td {
        padding: 0.5em 0.3em;
        font-size: 0.88rem;
    }

    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-content h3 {
        font-size: 1em;
    }

    .card-value {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .summary-stats {
        grid-template-columns: 1fr;
    }

    .summary-card {
        padding: 1em;
        flex-direction: column;
        text-align: center;
    }

    .card-icon {
        font-size: 2em;
    }
}