/**
 * Router Monitoring UI Styles - Phase 9
 * Styling for router management dashboard
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

.monitoring-header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.monitoring-header h1 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.header-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 120px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    background: #f8f9fa;
}

.stat-card.online {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.stat-card.offline {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.stat-card.alerts {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

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

.alert-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: bold;
}

section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

section h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.controls, .chart-controls, .speed-test-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.controls label, .chart-controls label, .speed-test-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.controls input[type="checkbox"] {
    margin-left: 5px;
}

.controls select, .chart-controls select, .speed-test-controls select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

button:hover {
    background: #2980b9;
}

button:active {
    background: #21618c;
}

/* Router Status Table */
.router-status-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.router-status-table thead {
    background: #34495e;
    color: white;
}

.router-status-table th,
.router-status-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.router-status-table tbody tr:hover {
    background: #f8f9fa;
}

.router-status-table tbody tr.offline {
    background: #fff5f5;
}

.router-status-table tbody tr.online {
    background: #f5fff5;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.status-online {
    background: #28a745;
    color: white;
}

.status-badge.status-offline {
    background: #dc3545;
    color: white;
}

.last-seen {
    font-size: 0.9em;
}

.last-seen.recent {
    color: #28a745;
}

.last-seen.recent-warning {
    color: #ffc107;
}

.last-seen.warning {
    color: #fd7e14;
}

.last-seen.critical {
    color: #dc3545;
    font-weight: bold;
}

/* Alerts Section */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert {
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid;
}

.alert.alert-critical {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.alert.alert-warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.alert.alert-info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

.alert strong {
    display: block;
    margin-bottom: 5px;
}

.alert small {
    display: block;
    margin-top: 5px;
    opacity: 0.8;
}

.no-alerts {
    color: #28a745;
    font-weight: bold;
    padding: 15px;
    text-align: center;
}

/* Router management */
.router-management-section {
    margin-top: 20px;
}

.router-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.router-form input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 180px;
}

.router-form button {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.router-form button:hover {
    background: #2980b9;
}

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

.router-list-table th,
.router-list-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.router-list-table th {
    background: #34495e;
    color: white;
}

.router-list-table tbody tr:hover {
    background: #f8f9fa;
}

/* Charts Section */
#signal-chart-container {
    position: relative;
    height: 400px;
    margin-top: 15px;
}

.chart-placeholder {
    text-align: center;
    color: #999;
    padding: 50px;
}

.signal-summary {
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 6px;
}

.signal-summary p {
    margin: 10px 0;
    font-size: 1.1em;
}

/* Speed Test Table */
.speed-test-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.speed-test-table thead {
    background: #34495e;
    color: white;
}

.speed-test-table th,
.speed-test-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.speed-test-table tbody tr:hover {
    background: #f8f9fa;
}

/* Loading States */
.loading {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .router-monitoring-container {
        padding: 10px;
    }
    
    .header-stats {
        flex-direction: column;
    }
    
    .stat-card {
        width: 100%;
    }
    
    .router-status-table,
    .speed-test-table {
        font-size: 0.85em;
    }
    
    .router-status-table th,
    .router-status-table td,
    .speed-test-table th,
    .speed-test-table td {
        padding: 8px;
    }
    
    .controls,
    .chart-controls,
    .speed-test-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls label,
    .chart-controls label,
    .speed-test-controls label {
        flex-direction: column;
        align-items: stretch;
    }
    
    #signal-chart-container {
        height: 300px;
    }
}
