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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --success-color: #10b981;
    --error-color: #ef4444;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, var(--bg-light) 0%, #e0e7ff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--bg-white);
    border-bottom: 2px solid var(--border-color);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header nav {
    text-align: center;
    margin-top: 1rem;
}

header nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

header nav a:hover {
    background: var(--primary-color);
    color: white;
}

main {
    flex: 1;
    max-width: 1200px;
    margin: 2rem auto;
    width: 100%;
    padding: 0 1rem;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    animation: fadeInDown 0.6s ease;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-gray);
    animation: fadeInUp 0.6s ease;
}

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

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

.health-section {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.health-section h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.refresh-indicator {
    font-size: 0.9rem;
    color: var(--success-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
}

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.health-card {
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.health-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.health-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.metric:last-child {
    border-bottom: none;
}

.metric .label {
    color: var(--text-gray);
    font-weight: 500;
    font-size: 0.9rem;
}

.metric .value {
    color: var(--text-dark);
    font-weight: 700;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
}

.raw-json-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.raw-json-section summary {
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.5rem;
    user-select: none;
    transition: color 0.2s ease;
}

.raw-json-section summary:hover {
    color: var(--primary-dark);
}

#health-raw {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-top: 1rem;
    font-family: 'Courier New', monospace;
}

.error-message {
    background: #fee2e2;
    color: var(--error-color);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border-left: 4px solid var(--error-color);
    font-weight: 500;
}

footer {
    background: var(--bg-white);
    border-top: 2px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h2 {
        font-size: 2rem;
    }

    .health-section {
        padding: 1.5rem;
    }

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

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary {
        width: 100%;
        text-align: center;
    }

    .refresh-indicator {
        width: 100%;
        text-align: center;
    }
}
