/**************************************************************************/
/*                                                                        */
/*   ___  _  _    _        _    ___ ___ ___                               */
/*  / __|| || |  /_\      /_\  | _ \_ _/ __|                              */
/*  \__ \| __ | / _ \    / _ \ |  _/| |\__ \                              */
/*  |___/|_||_|/_/ \_\  /_/ \_\|_| |___|___/                              */
/*                                                                        */
/**************************************************************************/

:root {
    --primary: #7580df;
    --primary-light: #9ba3ec;
    --primary-dark: #4f5aa1;
    --background: #0f1729;
    --card-bg: #1a2236;
    --text: #e2e8f0;
    --text-light: #94a3b8;
    --error: #ef4444;
    --error-bg: #451717;
    --success: #22c55e;
    --success-bg: #132e1a;
    --warning: #eab308;
    --warning-bg: #3f2f08;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
}

/* HEADER */
.header {
    background: linear-gradient(135deg, #1e1b4b 0%, #3730a3 100%);
    color: white;
    padding: clamp(3rem, 10vh, 6rem) 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    top: -200px;
    left: -200px;
    animation: morph 15s ease-in-out infinite;
}

.header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    position: relative;
}

/* DEFAULT PAGE */
.container.default-page {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.container.default-page::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle at center, rgba(122, 174, 222, 0.1) 0%, transparent 70%);
    z-index: -1;
}

.container.default-page h2 {
    color: var(--primary);
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1.5rem;
    font-weight: 700;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards;
}

/* STATUS BADGE */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ecfdf5;
    color: #059669;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 500;
    margin: 1rem 0;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards 0.4s;
}

.status-badge svg {
    width: 16px;
    height: 16px;
}

/* INFO CARDS */
.info-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards 0.6s;
}

.info-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(122, 174, 222, 0.1), rgba(13, 52, 88, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(122, 174, 222, 0.2);
}

.info-card:hover::before {
    opacity: 1;
}

.info-icon {
    width: 48px;
    height: 48px;
    background: rgba(122, 174, 222, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
    transition: all 0.3s ease;
}

.info-icon svg {
    width: 24px;
    height: 24px;
}

.info-card:hover .info-icon {
    transform: scale(1.1);
    background: var(--primary);
    color: white;
}

.info-card h3 {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.info-card p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

/* METRICS CONTAINER */
.metrics-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.metrics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.metrics-header h2 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 600;
}

.refresh-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.refresh-button svg {
    width: 20px;
    height: 20px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* METRIC CARDS */
.metric-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(122, 174, 222, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.metric-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2);
}

.wide-card {
    grid-column: 1 / -1;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(122, 174, 222, 0.1);
}

.metric-icon svg {
    width: 24px;
    height: 24px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(122, 174, 222, 0.1);
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--primary-light);
}

/* USAGE BARS */
.usage-bars {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.usage-item {
    width: 100%;
}

.usage-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.progress-bar {
    height: 8px;
    background: rgba(122, 174, 222, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* CONTAINERS LIST */
.containers-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding-top: 2rem;
}

.nginx-container {
    width: 400px;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
    border: 1px solid var(--primary);
    background: linear-gradient(to bottom, var(--card-bg), rgba(117, 128, 223, 0.1));
}

.nginx-container::after {
    content: '';
    position: absolute;
    bottom: -2rem;
    left: 50%;
    width: 2px;
    height: 2rem;
    background: var(--primary);
    transform-origin: top;
    transform: translateX(-50%);
}

.other-containers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 4rem;
    position: relative;
    width: 100%;
    max-width: 1200px;
}

.other-containers::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: 50%;
    width: 80%;
    height: 2px;
    background: var(--primary);
    transform: translateX(-50%);
}

.connection-lines::before {
    content: '';
    position: absolute;
    top: -2rem;
    width: 2px;
    height: 2rem;
    background: var(--primary);
}

.connection-lines.left::before {
    left: calc(25% - 1px);
    transform: rotate(30deg);
    transform-origin: bottom;
}

.connection-lines.right::before {
    right: calc(25% - 1px);
    transform: rotate(-30deg);
    transform-origin: bottom;
}

.container-item {
    background: var(--card-bg);
    border: 1px solid rgba(122, 174, 222, 0.1);
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.container-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.container-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(122, 174, 222, 0.1);
}

.stat-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.container-uptime {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.uptime-value {
    color: var(--primary-light);
    font-weight: 500;
}

.container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.container-name {
    font-weight: 600;
    color: var(--primary-light);
    font-size: 1.1rem;
}

.container-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
}

.status-up {
    color: var(--success);
    background: var(--success-bg);
}

.status-down {
    color: var(--error);
    background: var(--error-bg);
}

.container-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* NETWORK & SERVICES */
.network-list,
.services-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.network-item,
.service-item {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    border: 1px solid rgba(122, 174, 222, 0.1);
}

.network-name,
.service-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.network-stats,
.service-description {
    font-size: 0.875rem;
    color: var(--text-light);
}

.network-stats {
    display: flex;
    gap: 1rem;
}

/* SYSTEM HEALTH */
.health-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.health-status-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.health-status {
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.health-status.healthy {
    background: var(--success-bg);
    color: var(--success);
}

.health-status.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.health-status.critical {
    background: var(--error-bg);
    color: var(--error);
}

.health-score {
    text-align: center;
}

.score-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-light);
    display: block;
}

.score-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.health-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.health-metric {
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(122, 174, 222, 0.1);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-light);
}

.health-issues {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.issue-item {
    padding: 0.5rem 1rem;
    background: var(--error-bg);
    color: var(--error);
    border-radius: 4px;
    font-size: 0.875rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ANIMATIONS */
@keyframes morph {
    0% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    50% {
        border-radius: 60% 40% 30% 70% / 50% 60% 40% 50%;
    }

    100% {
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 768px) {
    .metrics-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .other-containers {
        grid-template-columns: 1fr;
    }

    .connection-lines::before,
    .other-containers::before {
        display: none;
    }

    .container-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}