:root {
    --bg-color: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #6366f1;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #db2777;
    bottom: -50px;
    right: -50px;
    animation-delay: -2s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: #0ea5e9;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 50px);
    }
}

.container {
    width: 90%;
    max-width: 1200px;
    z-index: 1;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeInDown 0.8s ease-out;
}

.range-selector {
    margin-top: 2rem;
    /* More space */
    display: inline-flex;
    background: rgba(15, 23, 42, 0.6);
    /* Darker background */
    padding: 0.4rem;
    border-radius: 1rem;
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.range-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1.2rem;
    /* Larger touch area */
    border-radius: 0.8rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.range-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.range-btn.active {
    background: var(--accent-color);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transform: scale(1.05);
    /* Proper animation */
}

h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

/* Fix emoji disappearing due to background-clip */
h1 .text-gradient {
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 .emoji {
    font-size: 2.5rem;
    /* Reset background clip for emoji */
    background: none;
    -webkit-text-fill-color: initial;
    color: initial;
    animation: float 3s ease-in-out infinite;
}

header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Badge fixes: Fixed width/Min-width to avoid resized/hidden text */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    margin-top: 1rem;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    white-space: nowrap;
    /* Prevent text wrap */
    min-width: 220px;
    /* Fixed min width */
}

/* Status indicator inside card */
.status-indicator {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    /* Ensure it doesn't expand weirdly */
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    /* Prevent text wrap */
    flex-shrink: 0;
    /* Prevent shrinking */
    min-width: 120px;
    /* Ensure badge has consistency */
    justify-content: center;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-secondary);
}

.status-badge.operational .dot {
    background-color: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
    animation: pulse 2s infinite;
}

.status-badge.issues .dot {
    background-color: var(--error-color);
    box-shadow: 0 0 10px var(--error-color);
    animation: pulse-red 2s infinite;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Glassmorphism Card */
.card {
    background: rgba(30, 41, 59, 0.7);
    /* Plus sombre et opaque */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    padding: 0;
    /* Padding géré en interne */
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    /* Accent border on hover */
}

/* Header style "Cover" */
.card-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-body {
    padding: 1.5rem;
}

.service-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon {
    font-size: 2.2rem;
    background: rgba(255, 255, 255, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.service-name {
    font-weight: 700;
    font-size: 1.3rem;
    color: #fff;
    letter-spacing: -0.025em;
}

.service-url {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    font-family: 'Consolas', monospace;
    /* Police monospace pour l'URL */
    opacity: 0.8;
}

.status-indicator {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    /* Pill shape */
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-indicator::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

.status-indicator.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.status-indicator.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

.metrics {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0;
    /* Enlevé le margin bottom car graph en dessous */
    padding-bottom: 1.5rem;
}

.metric {
    text-align: center;
    flex: 1;
    position: relative;
}

.metric:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 10%;
    height: 80%;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.4rem;
    /* Plus gros */
    font-weight: 700;
    color: var(--text-primary);
}

/* Uptime Bar Wrapper */
.uptime-container {
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.uptime-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.uptime-graph {
    display: flex;
    gap: 3px;
    height: 40px;
    /* Un peu plus haut */
    align-items: flex-end;
    justify-content: flex-end;
    /* Force lines to right */
    width: 100%;
    /* Ensure full width */
}

.bar {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    /* More rounded */
    transition: all 0.3s ease;
    min-width: 4px;
    /* Minimum width pour visibilité */
}

.bar.up {
    background: linear-gradient(to top, var(--success-color), #34d399);
    /* Gradient */
    opacity: 0.7;
}

.bar.down {
    background: linear-gradient(to top, var(--error-color), #f87171);
    opacity: 0.7;
}

.bar:hover {
    opacity: 1;
    transform: scaleY(1.15);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Skeleton Loading */
.skeleton {
    height: 200px;
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, var(--card-bg) 4%, rgba(255, 255, 255, 0.1) 25%, var(--card-bg) 36%);
    background-size: 1000px 100%;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}