/* Service Status Dashboard Styles */

:root {
    --color-success: #10b981;
    --color-success-dark: #059669;
    --color-warning: #f59e0b;
    --color-warning-dark: #d97706;
    --color-danger: #ef4444;
    --color-danger-dark: #dc2626;
    --color-unknown: #6b7280;
    --color-bg: #0f172a;
    --color-bg-card: #1e293b;
    --color-bg-hover: #334155;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --color-border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--color-success), #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

/* Status Banner */
.status-banner {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow);
}

.status-banner.status-operational {
    border-color: var(--color-success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), var(--color-bg-card));
}

.status-banner.status-degraded {
    border-color: var(--color-warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), var(--color-bg-card));
}

.status-banner.status-down {
    border-color: var(--color-danger);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), var(--color-bg-card));
}

.status-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.status-icon {
    font-size: 2rem;
}

.status-text {
    font-size: 1.5rem;
    font-weight: 700;
}

.status-operational .status-text {
    color: var(--color-success);
}

.status-degraded .status-text {
    color: var(--color-warning);
}

.status-down .status-text {
    color: var(--color-danger);
}

.last-updated {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-align: right;
}

/* Summary Stats */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Endpoints Section */
.endpoints-section {
    margin-bottom: 2rem;
}

.endpoints-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.endpoints-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.endpoint-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
    transition: transform 0.2s, border-color 0.2s;
}

.endpoint-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-success);
}

.endpoint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.endpoint-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
}

.endpoint-url {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-family: monospace;
    background: var(--color-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    word-break: break-all;
}

.endpoint-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.endpoint-stat {
    display: flex;
    flex-direction: column;
}

.endpoint-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.endpoint-stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.availability-good {
    color: var(--color-success);
}

.availability-warning {
    color: var(--color-warning);
}

.availability-bad {
    color: var(--color-danger);
}

/* Timeline */
.timeline-container {
    margin-top: 1rem;
}

.timeline-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.timeline {
    display: flex;
    gap: 1px;
    height: 40px;
    background: var(--color-bg);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.timeline-bar {
    flex: 1;
    min-width: 2px;
    transition: opacity 0.2s;
    cursor: pointer;
    position: relative;
}

.timeline-bar:hover {
    opacity: 0.8;
}

.timeline-bar.status-up {
    background: var(--color-success);
}

.timeline-bar.status-down {
    background: var(--color-danger);
}

.timeline-bar.status-unknown {
    background: var(--color-unknown);
}

/* Tooltip */
.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 100;
    box-shadow: var(--shadow);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    margin-bottom: 0.5rem;
}

.timeline-bar:hover .tooltip {
    opacity: 1;
}

.tooltip-time {
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.tooltip-status {
    font-weight: 600;
}

.tooltip-status.up {
    color: var(--color-success);
}

.tooltip-status.down {
    color: var(--color-danger);
}

/* Timeline Legend */
.timeline-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

.legend-color.up {
    background: var(--color-success);
}

.legend-color.down {
    background: var(--color-danger);
}

.legend-color.unknown {
    background: var(--color-unknown);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--color-border);
    margin-top: 2rem;
}

footer p {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .status-content {
        flex-direction: column;
        text-align: center;
    }

    .last-updated {
        text-align: center;
    }

    .endpoint-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .endpoint-stats {
        gap: 1rem;
    }

    .timeline {
        height: 30px;
    }
}

/* Animation for status changes */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-banner.loading {
    animation: pulse 2s infinite;
}
