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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    font-size: 32px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.last-update {
    color: #7f8c8d;
    font-size: 14px;
}

.alert {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideIn 0.5s ease;
}

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

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

#services-container {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 300px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
    font-size: 18px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.service-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #95a5a6;
    transition: all 0.3s;
}

.service-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.service-card.status-up {
    border-left-color: #27ae60;
}

.service-card.status-down {
    border-left-color: #e74c3c;
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.service-name {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-badge.up {
    background: #d4edda;
    color: #155724;
}

.status-badge.up::before {
    background: #27ae60;
}

.status-badge.down {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.down::before {
    background: #e74c3c;
}

.status-badge.unknown {
    background: #e2e3e5;
    color: #383d41;
}

.status-badge.unknown::before {
    background: #95a5a6;
}

/* History bar styles */
.history-section {
    margin-top: 10px;
}

.history-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-bar {
    display: flex;
    gap: 2px;
    height: 24px;
    background: #e9ecef;
    border-radius: 4px;
    padding: 3px;
    overflow: hidden;
}

.history-segment {
    flex: 1;
    min-width: 8px;
    border-radius: 2px;
    transition: transform 0.2s;
    cursor: pointer;
}

.history-segment:hover {
    transform: scaleY(1.2);
}

.history-segment.history-up {
    background: #27ae60;
}

.history-segment.history-down {
    background: #e74c3c;
}

.history-empty {
    color: #95a5a6;
    font-size: 12px;
    text-align: center;
    padding: 4px;
}

.backend-offline-warning {
    text-align: center;
    padding: 60px 20px;
}

.backend-offline-warning h2 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 28px;
}

.backend-offline-warning p {
    color: #7f8c8d;
    font-size: 16px;
    line-height: 1.6;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    font-size: 14px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 24px;
    }

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