/* Governance Dashboard Styles */

.governance-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Summary Cards */
.governance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: var(--card-background, #fff);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    text-align: center;
    border-left: 4px solid #dadce0;
}

.summary-card.healthy { border-left-color: #34a853; }
.summary-card.warning { border-left-color: #fbbc04; }
.summary-card.critical { border-left-color: #ea4335; }
.summary-card.info { border-left-color: #4285f4; }

.summary-card .card-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

.summary-card .card-label {
    font-size: 13px;
    color: #5f6368;
    margin-top: 4px;
}

/* Health Score Gauge */
.health-gauge {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    position: relative;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.health-gauge .gauge-value {
    font-size: 28px;
    font-weight: 700;
    z-index: 1;
}

.health-gauge .gauge-label {
    font-size: 11px;
    color: #5f6368;
    position: absolute;
    bottom: 20px;
}

.health-gauge.score-good { background: conic-gradient(#34a853 var(--score-pct, 0%), #e8f5e9 0%); }
.health-gauge.score-warn { background: conic-gradient(#fbbc04 var(--score-pct, 0%), #fff8e1 0%); }
.health-gauge.score-bad { background: conic-gradient(#ea4335 var(--score-pct, 0%), #fce8e6 0%); }

.health-gauge::after {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: white;
}

.health-gauge .gauge-value { z-index: 2; }

/* Severity Badges */
.severity-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-badge.critical { background: #fce8e6; color: #c5221f; }
.severity-badge.warning { background: #fef7e0; color: #e37400; }
.severity-badge.info { background: #e8f0fe; color: #1967d2; }
.severity-badge.healthy { background: #e6f4ea; color: #137333; }

/* Charts Section */
.governance-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--card-background, #fff);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.chart-card h3 {
    font-size: 15px;
    margin-bottom: 12px;
    color: #202124;
}

/* Violations Table */
.violations-section {
    background: var(--card-background, #fff);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    overflow: hidden;
    margin-bottom: 24px;
}

.violations-header {
    padding: 16px 20px;
    border-bottom: 1px solid #dadce0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.violations-header h3 {
    font-size: 16px;
    margin: 0;
}

.violations-filters {
    display: flex;
    gap: 8px;
}

.violations-filters .filter-btn {
    padding: 4px 12px;
    border-radius: 16px;
    border: 1px solid #dadce0;
    background: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.violations-filters .filter-btn.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.violations-filters .filter-btn:hover:not(.active) {
    background: #f1f3f4;
}

.violations-table {
    width: 100%;
    border-collapse: collapse;
}

.violations-table th {
    background: #f8f9fa;
    padding: 10px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #dadce0;
}

.violations-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.violations-table tr:hover {
    background: #f8f9fa;
}

.violations-table .space-name {
    font-weight: 500;
    color: #1a73e8;
}

.violations-table .rule-name {
    color: #202124;
}

.violations-table .violation-details {
    color: #5f6368;
    font-size: 12px;
}

/* Quick Fix Button */
.btn-quickfix {
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid #dadce0;
    background: white;
    font-size: 11px;
    cursor: pointer;
    color: #1a73e8;
    transition: all 0.2s;
}

.btn-quickfix:hover {
    background: #e8f0fe;
    border-color: #1a73e8;
}

/* Rules Configuration Panel */
.rules-config {
    background: var(--card-background, #fff);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.rules-config h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.rule-item:last-child {
    border-bottom: none;
}

.rule-item .rule-toggle {
    flex-shrink: 0;
}

.rule-item .rule-info {
    flex: 1;
}

.rule-item .rule-name {
    font-weight: 500;
    font-size: 14px;
}

.rule-item .rule-severity {
    margin-left: 8px;
}

.rule-item .rule-params {
    font-size: 12px;
    color: #5f6368;
    margin-top: 2px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #dadce0;
    border-radius: 22px;
    transition: 0.3s;
}

.toggle-switch .slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.toggle-switch input:checked + .slider {
    background: #1a73e8;
}

.toggle-switch input:checked + .slider::before {
    transform: translateX(18px);
}

/* Scan Progress */
.scan-progress {
    background: #e8f0fe;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.scan-progress .spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #dadce0;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Health dot indicator for main table */
.health-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.health-dot.green { background: #34a853; }
.health-dot.yellow { background: #fbbc04; }
.health-dot.red { background: #ea4335; }
.health-dot.gray { background: #dadce0; }

/* Empty state */
.governance-empty {
    text-align: center;
    padding: 60px 20px;
    color: #5f6368;
}

.governance-empty i {
    font-size: 48px;
    color: #dadce0;
    margin-bottom: 16px;
}

.governance-empty h3 {
    margin-bottom: 8px;
    color: #202124;
}

/* Responsive */
@media (max-width: 768px) {
    .governance-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .governance-charts {
        grid-template-columns: 1fr;
    }

    .violations-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
