:root {
    --bg-color: #fbebf1; /* Pale Sakura Pink */
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-primary: #5c4b51; /* Dark brownish pink for text */
    --text-secondary: #8c7b81;
    --accent-color: #ffb7c5; /* Sakura Pink */
    --success-color: #8ccf7c; /* Pastel Green */
    --warning-color: #ffcc80; /* Pastel Orange */
    --error-color: #ff8fa3; /* Pastel Red */
    --unknown-color: #d1c4c8;
    --font-family: 'Comfortaa', cursive, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 183, 197, 0.2) 0%, transparent 20%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: #e06c75; /* A bit stronger pink for links */
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Prevent shrinking */
}

#logo {
    height: 40px;
    width: 40px;
    object-fit: contain;
}

#logo.hidden {
    opacity: 0;
    visibility: hidden;
}

h1 {
    font-weight: 700;
    font-size: 2rem;
    color: var(--text-primary);
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.5);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: var(--text-secondary);
    font-weight: 600;
}

nav a:hover {
    color: var(--text-primary);
}

/* Intro */
.intro-message {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.4);
    padding: 1.5rem;
    border-radius: 16px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.intro-message p {
    margin-bottom: 0.5rem;
}

/* Global Status */
.status-summary {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    backdrop-filter: blur( 8.5px );
    -webkit-backdrop-filter: blur( 8.5px );
    border: 1px solid rgba( 255, 255, 255, 0.4 );
    font-size: 1.2rem;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.status-summary:hover {
    transform: translateY(-2px);
}

.status-summary.up {
    border-left: 8px solid var(--success-color);
}
.status-summary.down {
    border-left: 8px solid var(--error-color);
}
.status-summary.degraded {
    border-left: 8px solid var(--warning-color);
}

/* Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* Service Card */
.service-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
    backdrop-filter: blur( 10px );
    -webkit-backdrop-filter: blur( 10px );
    border: 1px solid rgba( 255, 255, 255, 0.5 );
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    z-index: 0;
}

.service-card > * {
    position: relative;
    z-index: 1;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    border-color: #fff;
}

/* Expanded State */
.service-card.expanded {
    /* grid-column: 1 / -1; */
    cursor: default;
    transform: none;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.service-name {
    font-weight: 700;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-primary);
}

.service-icon {
    height: 28px;
    width: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.1));
}

.status-pill {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.5);
}

.status-pill.up {
    background-color: #e3f9e5; /* Very pale green */
    color: #5c9c54;
}

.status-pill.down {
    background-color: #ffe5e9;
    color: #e57373;
}

.status-pill.degraded {
    background-color: #fff8e1;
    color: #ffb74d;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.3);
    padding: 1rem;
    border-radius: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
    margin-bottom: 0.2rem;
}

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

/* Graph Container */
.graph-container {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    max-height: 1000px;
    opacity: 1;
    overflow: hidden;
    transition: all 0.5s ease-in-out;
}

.graph-container.hidden {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    border-top-color: transparent;
    border-top-width: 0;
}

.graph-controls {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1rem;
    justify-content: flex-end;
}

.graph-controls button {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.graph-controls button:hover,
.graph-controls button.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 10px rgba(255, 183, 197, 0.5);
}

.graph-image-wrapper {
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.5);
    padding: 15px;
    border: 1px solid white;
}

.graph-img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: contain;
    mix-blend-mode: multiply; /* Helps graph blend if it has white bg */
}

/* Footer */
footer {
    margin-top: 5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding-bottom: 3rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 183, 197, 0.8);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 183, 197, 1);
}

/* Skeleton Loading */
.skeleton {
    cursor: wait;
}

.skeleton-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
}

.skeleton-text {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    height: 1em;
}

.skeleton-text.title {
    width: 150px;
    height: 1.3rem;
}

.skeleton-text.label {
    width: 60px;
    height: 1.2rem;
    margin-bottom: 0.2rem;
}

.skeleton-text.value {
    width: 40px;
    height: 1.75rem;
}

.skeleton-pill {
    width: 80px;
    height: 36px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
}

/* Skeleton Animation */
.skeleton .skeleton-icon,
.skeleton .skeleton-text,
.skeleton .skeleton-pill {
    animation: skeleton-pulse 1.5s infinite ease-in-out;
}

@keyframes skeleton-pulse {
    0% { opacity: 0.4; }
    50% { opacity: 0.8; }
    100% { opacity: 0.4; }
}

/* Detailed Stats */
.detailed-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.stat-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-small .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
}

.stat-small .value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}
