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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 1.8rem;
    color: #1a1a1a;
    margin-bottom: 6px;
}

.overall-status {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.overall-status.operational {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.overall-status.degraded {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.overall-status.outage {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.status-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.overall-status h2 {
    font-size: 1rem;
    margin-bottom: 3px;
}

.last-updated {
    font-size: 0.75rem;
    opacity: 0.85;
}

.services {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.service-item {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 14px;
    transition: box-shadow 0.3s ease;
}

.service-item:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

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

.service-name {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 8px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.operational { background-color: #10b981; }
.status-indicator.degraded { background-color: #f59e0b; }
.status-indicator.partial { background-color: #ef4444; }
.status-indicator.outage { background-color: #dc2626; }
.status-indicator.maintenance { background-color: #3b82f6; }

.service-status {
    color: #10b981;
    font-weight: 600;
}

.service-status.degraded { color: #f59e0b; }
.service-status.partial { color: #ef4444; }
.service-status.outage { color: #dc2626; }
.service-status.maintenance { color: #3b82f6; }

.uptime-graph {
    margin-top: 15px;
}

.uptime-bars {
    display: flex;
    gap: 2px;
    height: 28px;
    margin-bottom: 8px;
}

.uptime-bar {
    flex: 1;
    background-color: #10b981;
    border-radius: 2px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.uptime-bar:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.uptime-tooltip {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) scale(1);
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 10px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 220px;
    font-size: 0.8rem;
    display: none;
    pointer-events: none;
    white-space: nowrap;
}

.uptime-bar:hover .uptime-tooltip {
    display: block;
}

.uptime-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
}

.tooltip-date {
    margin-bottom: 6px;
}

.tooltip-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tooltip-status.status-operational { font-weight: 600; }
.tooltip-status.status-yellow { color: #d97706; font-weight: 600; }
.tooltip-status.status-orange { color: #c2410c; font-weight: 600; }
.tooltip-status.status-red { color: #dc2626; font-weight: 600; }
.tooltip-status.no-data { color: #9ca3af; }

.tooltip-incidents {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e5e7eb;
    color: #666;
    white-space: normal;
    max-width: 250px;
}

.tooltip-incident-item {
    margin-bottom: 2px;
    line-height: 1.4;
}

.uptime-bar.operational { background-color: #10b981; }
.uptime-bar.yellow { background-color: #fbbf24; }
.uptime-bar.orange { background-color: #d97706; }
.uptime-bar.red { background-color: #dc2626; }
.uptime-bar.degraded { background-color: #f59e0b; }
.uptime-bar.partial { background-color: #ef4444; }
.uptime-bar.outage { background-color: #dc2626; }
.uptime-bar.maintenance { background-color: #3b82f6; }
.uptime-bar.no-data { background-color: #e5e7eb; }

.uptime-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #666;
}

.uptime-percentage {
    font-weight: 600;
    font-size: 0.75rem;
    color: #666;
}

footer {
    text-align: center;
    color: #666;
    font-size: 0.8rem;
    margin-top: 30px;
}

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

    .overall-status {
        padding: 15px 20px;
    }

    .overall-status h2 {
        font-size: 1.1rem;
    }

    .status-icon {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    .services {
        padding: 20px;
    }

    .service-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 40px;
}

.admin-controls {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.logout-btn {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.logout-btn:hover {
    background: #dc2626;
}

.admin-link {
    color: #999;
    text-decoration: none;
    margin-left: 10px;
}

.admin-link:hover {
    color: #667eea;
}

.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.login-box {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 300px;
}

.login-box h2 {
    margin-bottom: 20px;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.login-box button[type="submit"] {
    width: 100%;
    padding: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.login-box button[type="submit"]:hover {
    background: #5a6fd6;
}

.close-login {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: #e5e7eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.login-error {
    color: #ef4444;
    text-align: center;
    margin-top: 10px;
}
