/**
 * WST Monitoring Dashboard - Styles
 * Clean, minimal, functional design
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0f0f0f;
    color: #e0e0e0;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
header {
    background: #1a1a1a;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #333;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #fff;
}

.header-info {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

#last-updated,
#next-refresh {
    font-size: 0.9rem;
    color: #888;
}

#refresh-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

#refresh-btn:hover:not(:disabled) {
    background: #1d4ed8;
}

#refresh-btn:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Hardware Section */
.hardware-section {
    background: #1a1a1a;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #333;
}

.hardware-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #fff;
}

/* Legend Section */
.legend-section {
    background: #1a1a1a;
    padding: 20px 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #333;
}

.legend-section h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #999;
    font-weight: 600;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-icon {
    font-size: 1.3rem;
}

.legend-label {
    color: #bbb;
    font-size: 0.9rem;
}

.hardware-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.metric {
    background: #0f0f0f;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #2a2a2a;
}

.metric-label {
    font-weight: 600;
    color: #999;
    margin-right: 10px;
}

.metric-value {
    font-size: 1.1rem;
    color: #fff;
    font-weight: 500;
}

/* Service Sections */
.service-section {
    background: #1a1a1a;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #333;
}

.service-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #fff;
}

/* Service Table */
.service-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.service-table thead {
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
}

.service-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #999;
    border-bottom: 2px solid #333;
}

.service-table tbody tr {
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.2s;
}

.service-table tbody tr:hover {
    background: #0f0f0f;
}

.service-table td {
    padding: 12px;
}

.status-cell {
    font-weight: 500;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-indicator.up {
    color: #22c55e;
}

.status-indicator.down {
    color: #ef4444;
}

/* Service row status colors */
.service-row.up {
    border-left: 3px solid #22c55e;
}

.service-row.down {
    border-left: 3px solid #ef4444;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.85rem;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .header-info {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .service-table {
        font-size: 0.85rem;
    }
    
    .service-table th,
    .service-table td {
        padding: 8px;
    }
}

/* Loading state */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
