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

:root {
    --primary-color: #10ff9f;
    --primary-dark: #0dd885;
    --secondary-color: #4ade80;
    --bg-dark: #000000;
    --bg-card: rgba(0, 0, 0, 0.8);
    --bg-card-hover: rgba(0, 0, 0, 0.9);
    --text-primary: #10ff9f;
    --text-secondary: #4ade80;
    --text-muted: rgba(74, 222, 128, 0.8);
    --border-color: rgba(16, 255, 159, 0.5);
    --healthy-color: #10ff9f;
    --degraded-color: #f59e0b;
    --down-color: #ef4444;
    --unknown-color: #6b7280;
}

body {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    background: var(--bg-dark);
    background-image: linear-gradient(rgba(74, 222, 128, 0.1) 1px, transparent 0), linear-gradient(90deg, rgba(74, 222, 128, 0.1) 1px, transparent 0);
    background-size: 40px 40px;
    background-position: -1px -1px;
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    position: relative;
}

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

header {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(4px);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.1), 0 0 20px rgba(74, 222, 128, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 16px;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    color: #10ff9f;
    text-shadow: 0 0 10px rgba(74, 222, 128, 0.5), 0 0 20px rgba(74, 222, 128, 0.3);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    display: block;
    margin: 0;
    padding: 0;
    visibility: visible;
    opacity: 1;
}

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

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-width: 80px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-item.healthy .stat-value {
    color: var(--healthy-color);
}

.stat-item.degraded .stat-value {
    color: var(--degraded-color);
}

.stat-item.down .stat-value {
    color: var(--down-color);
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.btn-refresh {
    background: var(--primary-color);
    color: #000000;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 0 15px rgba(16, 255, 159, 0.5);
    position: relative;
}

.btn-refresh:hover {
    background: rgba(16, 255, 159, 0.9);
    box-shadow: 0 0 20px rgba(16, 255, 159, 0.7);
}

.btn-refresh:active {
    transform: translateY(0);
}

.btn-refresh:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.last-update {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.update-label {
    color: var(--text-muted);
}

#last-update-time {
    font-weight: 600;
    color: var(--text-primary);
}

main {
    position: relative;
}

.loading, .error {
    text-align: center;
    padding: 40px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 16px;
    backdrop-filter: blur(4px);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.error {
    color: var(--down-color);
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--down-color);
}

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

.instance-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.instance-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.3), 0 0 20px rgba(74, 222, 128, 0.2);
    border-color: var(--primary-color);
}

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

.instance-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.healthy {
    background: rgba(16, 255, 159, 0.2);
    color: var(--healthy-color);
    border: 1px solid var(--healthy-color);
}

.status-badge.degraded {
    background: rgba(245, 158, 11, 0.2);
    color: var(--degraded-color);
    border: 1px solid var(--degraded-color);
}

.status-badge.down {
    background: rgba(239, 68, 68, 0.2);
    color: var(--down-color);
    border: 1px solid var(--down-color);
}

.status-badge.unknown {
    background: rgba(107, 114, 128, 0.2);
    color: var(--unknown-color);
    border: 1px solid var(--unknown-color);
}

.instance-url {
    color: var(--text-muted);
    font-size: 14px;
    word-break: break-all;
    margin-bottom: 16px;
    font-family: 'Monaco', 'Courier New', monospace;
}

.instance-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.detail-label {
    color: var(--text-muted);
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
}

.detail-value.status-code {
    font-family: 'Monaco', 'Courier New', monospace;
}

.response-time {
    color: var(--text-secondary);
}

.response-time.fast {
    color: var(--healthy-color);
}

.response-time.slow {
    color: var(--degraded-color);
}

.response-time.very-slow {
    color: var(--down-color);
}

.error-message {
    color: var(--down-color);
    font-size: 13px;
    margin-top: 8px;
    padding: 8px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--down-color);
}

.last-checked {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-stats {
        width: 100%;
        justify-content: space-between;
    }

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

    h1 {
        font-size: 24px;
    }
}

