:root {
    --bg-color: #0d1b2a;
    --grid-color: rgba(65, 90, 119, 0.1);
    --primary-color: #4cc9f0;
    --secondary-color: #4895ef;
    --danger-color: #f72585;
    --warning-color: #f7b801;
    --success-color: #06d6a0;
    /* Orange */
    --text-color: #e0e1dd;
    --header-bg: rgba(13, 27, 42, 0.95);
    --card-bg: rgba(27, 38, 59, 1);
    --border-color: rgba(72, 149, 239, 0.3);
    --font-main: 'Share Tech Mono', monospace;
    --border-radius: 16px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background Grid Animation */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 200vw;
    height: 200vh;
    background-image:
        radial-gradient(circle, var(--grid-color) 2px, transparent 2px);
    background-size: 50px 50px;
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(72, 149, 239, 0.15) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 50px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo .icon {
    font-size: 28px;
    color: var(--primary-color);
    filter: drop-shadow(0 0 5px var(--primary-color));
}

.logo h1 {
    font-size: 26px;
    letter-spacing: 1px;
    color: #fff;
}

.system-status {
    font-size: 16px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.status-indicator {
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    transition: all 0.3s;
}

.status-indicator.ok {
    color: var(--bg-color);
    background: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-color);
}

.status-indicator.degraded,
.status-indicator.down {
    color: #fff;
    background: var(--danger-color);
    box-shadow: 0 0 15px var(--danger-color);
}

/* Intro Box */
.intro-box {
    text-align: center;
    padding: 40px 20px 20px;
    font-size: 20px;
    opacity: 0.9;
}

.highlight {
    color: var(--primary-color);
    font-weight: bold;
    text-shadow: 0 0 10px rgba(76, 201, 240, 0.5);
}

/* Main */
main {
    flex: 1;
}

/* Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding: 40px 60px;
    flex: 1;
}

.model-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
}

.model-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(72, 149, 239, 0.2);
    border-color: var(--primary-color);
}

/* Status light */
.model-card::after {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #555;
    /* Default/Pending */
    box-shadow: 0 0 5px #555;
    transition: all 0.3s;
}

.model-card.healthy::after {
    background: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
}

.model-card.partial::after {
    background: var(--warning-color);
    box-shadow: 0 0 10px var(--warning-color);
}

.model-card.unhealthy::after {
    background: var(--danger-color);
    box-shadow: 0 0 10px var(--danger-color);
}

.model-card.loading::after {
    background: #555;
    box-shadow: 0 0 5px #555;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}


/* ... existing code ... */

.status-badge.healthy {
    background: rgba(76, 201, 240, 0.2);
    color: var(--primary-color);
}

.status-badge.partial {
    background: rgba(247, 184, 1, 0.2);
    color: var(--warning-color);
}

.status-badge.unhealthy {
    background: rgba(247, 37, 133, 0.2);
    color: var(--danger-color);
}

.model-card {
    cursor: pointer;
}

.model-card h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #fff;
    padding-right: 20px;
}

.instance-count {
    color: var(--secondary-color);
    font-size: 14px;
    margin-bottom: 15px;
}

/* Hover Details Overlay */
.details-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 27, 42, 0.95);
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    font-size: 13px;
    border-radius: var(--border-radius);
}

.model-card:hover .details-overlay {
    opacity: 1;
    visibility: visible;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #555;
}

.detail-item.healthy {
    border-left-color: var(--primary-color);
}

.detail-item.unhealthy {
    border-left-color: var(--danger-color);
}

.detail-host {
    opacity: 0.8;
}

.detail-latency {
    font-weight: bold;
}

/* Footer */
footer {
    padding: 30px 50px;
    background: var(--header-bg);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.links {
    display: flex;
    gap: 20px;
}

.btn {
    text-decoration: none;
    color: #fff;
    background: var(--secondary-color);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.btn:hover {
    background: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 15px rgba(76, 201, 240, 0.4);
}

header .links {
    display: flex;
    gap: 15px;
}

header .btn {
    padding: 8px 16px;
    font-size: 14px;
}

.terminal-line {
    opacity: 0.5;
    font-size: 14px;
}

.blink {
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 10px;
}

/* Command Box */
/* Command Box */
.command-box {
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    font-family: monospace;
    font-size: 11px;
    color: #a0c4ff;
    color: #a0c4ff;
    overflow: hidden;
    /* Header shouldn't scroll */
    position: relative;
    line-height: 1.4;
}

.command-text,
#modal-command-text {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

.global-commands {
    max-width: 800px;
    margin: 15px auto 0;
    padding: 0;
}

.global-commands-details {
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 60px;
}

.global-commands-details summary {
    cursor: pointer;
    font-size: 13px;
    color: var(--secondary-color);
    opacity: 0.6;
    transition: all 0.2s;
    user-select: none;
    outline: none;
    list-style: none;
    text-align: center;
}

.global-commands-details summary::-webkit-details-marker {
    display: none;
}

.global-commands-details summary:hover {
    opacity: 1;
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(76, 201, 240, 0.4);
}

.global-commands-details[open] summary {
    margin-bottom: 10px;
    opacity: 0.8;
}

.command-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.copy-btn {
    background: transparent;
    border: none;
    color: #666;
    padding: 2px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
    transform: none;
}

.copy-btn:active {
    transform: scale(0.95);
}

.command-label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
    color: #666;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 27, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: linear-gradient(145deg, var(--card-bg), rgba(20, 30, 50, 1));
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 30px;
    width: 90%;
    max-width: 650px;
    box-shadow: 0 0 50px rgba(76, 201, 240, 0.15);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.modal-header h2 {
    color: var(--primary-color);
    font-size: 26px;
    text-shadow: 0 0 10px rgba(76, 201, 240, 0.3);
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

.close-btn:hover {
    color: var(--danger-color);
    transform: scale(1.1) rotate(90deg);
}

.modal-section {
    margin-bottom: 25px;
}

.modal-section h3 {
    margin-bottom: 15px;
    font-size: 16px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-color);
}

/* Detail Items with Animation */
.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 4px solid #555;
    margin-bottom: 10px;
    opacity: 0;
    /* Changed in JS */
    animation: slideIn 0.4s ease-out forwards;
    transition: transform 0.2s;
}

.detail-item:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.06);
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.detail-item.healthy {
    border-left-color: var(--primary-color);
}

.detail-item.unhealthy {
    border-left-color: var(--danger-color);
}

.detail-host {
    font-family: monospace;
    font-size: 14px;
    color: #e0e1dd;
}

.detail-latency {
    font-weight: bold;
    font-size: 13px;
    color: var(--secondary-color);
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.healthy {
    background: rgba(76, 201, 240, 0.2);
    color: var(--primary-color);
}

.status-badge.unhealthy {
    background: rgba(247, 37, 133, 0.2);
    color: var(--danger-color);
}

.model-card {
    cursor: pointer;
}

.details-overlay {
    display: none !important;
}

.hf-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    transition: all 0.3s;
    width: fit-content;
    position: relative;
    z-index: 2;
}

.hf-link:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(76, 201, 240, 0.4);
    transform: translateY(-2px);
}

.hf-icon {
    font-size: 16px;
}