/* ========================================
   SAFETY DASHBOARD STYLES
   ======================================== */

.safety-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header Section */
.safety-header {
    margin-bottom: 3rem;
}

.safety-header h1 {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.safety-header p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1.5rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

/* Health Summary Widget */
.health-summary-widget {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.health-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.health-indicator {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.health-indicator.healthy {
    background: rgba(76, 175, 80, 0.3);
}

.health-indicator.warning {
    background: rgba(255, 152, 0, 0.3);
}

.health-indicator.critical {
    background: rgba(244, 67, 54, 0.3);
}

.health-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.health-status {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.health-time {
    font-size: 0.9rem;
    opacity: 0.9;
}

.health-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Incident Alert */
.incidents-alert {
    margin-bottom: 2rem;
}

.alert {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.alert strong {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.alert p {
    margin: 0.5rem 0;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    color: #1a1a1a;
    margin: 0;
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.filter-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: white;
    cursor: pointer;
}

/* Bot Health Breakdown */
.bot-health-breakdown {
    margin-bottom: 3rem;
}

.bots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.bot-health-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.bot-health-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.bot-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.bot-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1a1a1a;
}

.bot-status-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.status-healthy {
    background: #c8e6c9;
    color: #2e7d32;
}

.status-warning {
    background: #ffe0b2;
    color: #e65100;
}

.status-critical {
    background: #ffcdd2;
    color: #c62828;
}

.bot-metrics {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95rem;
}

.metric-label {
    color: #666;
}

.metric-value {
    font-weight: bold;
    color: #1a1a1a;
}

.metric-value.positive {
    color: #4caf50;
}

.metric-value.negative {
    color: #f44336;
}

.anomaly-gauge {
    margin-top: 1rem;
}

.gauge-label {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 0.5rem;
}

.gauge-bar {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

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

.gauge-fill.green {
    background: #4caf50;
}

.gauge-fill.yellow {
    background: #ffc107;
}

.gauge-fill.red {
    background: #f44336;
}

.bot-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.bot-actions button {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.85rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.bot-actions button:hover {
    background: #f5f5f5;
    border-color: #999;
}

/* Alerts Table */
.alerts-log {
    margin-bottom: 3rem;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #eee;
}

.alerts-table {
    overflow-x: auto;
}

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

.alerts-table th {
    background: #f5f5f5;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid #eee;
    font-size: 0.95rem;
}

.alerts-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.alerts-table tr:hover {
    background: #f9f9f9;
}

.alert-time {
    color: #999;
    font-size: 0.9rem;
}

.alert-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
}

.badge-p1 {
    background: #ffebee;
    color: #c62828;
}

.badge-p2 {
    background: #fff3e0;
    color: #e65100;
}

.badge-p3 {
    background: #e3f2fd;
    color: #1565c0;
}

/* Quick Actions */
.quick-actions {
    margin-bottom: 3rem;
}

.quick-actions h2 {
    margin-bottom: 1.5rem;
    color: #1a1a1a;
}

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

.action-card {
    background: white;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95rem;
    font-weight: 500;
}

.action-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.action-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.action-label {
    display: block;
    color: #1a1a1a;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    margin: 0;
    color: #1a1a1a;
}

.close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #1a1a1a;
}

.form-group input[type="number"],
.form-group input[type="time"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.help-text {
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.3rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.time-range {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-range input {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-actions button {
    flex: 1;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f5f5f5;
    color: #1a1a1a;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #eee;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-link {
    background: none;
    color: #667eea;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: #5568d3;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .health-summary-widget {
        grid-template-columns: 1fr;
    }

    .health-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .bots-grid {
        grid-template-columns: 1fr;
    }

    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .alerts-table {
        font-size: 0.85rem;
    }

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

    .header-actions {
        flex-direction: column;
    }

    .header-actions button {
        width: 100%;
    }
}
