:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #a855f7;
    --accent: #22d3ee;
    --bg-dark: #020617;
    --bg-card: rgba(15, 23, 42, 0.6);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.3);
    --danger: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4rem;
    width: 100%;
}

/* --- Animated Mesh Background --- */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: #020617;
}

.background-mesh::before,
.background-mesh::after {
    content: '';
    position: absolute;
    width: 80vmax;
    height: 80vmax;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    z-index: -1;
    animation: drift 30s infinite alternate ease-in-out;
}

.background-mesh::before {
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    top: -20%;
    left: -10%;
}

.background-mesh::after {
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    bottom: -20%;
    right: -10%;
    animation-delay: -15s;
}

@keyframes drift {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(10%, 15%) scale(1.1);
    }
}

/* --- Noise Overlay --- */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- Typography --- */
h1,
h2,
h3,
.stat-value {
    font-family: 'Outfit', sans-serif;
}

/* --- Header --- */
.app-header {
    background: rgba(2, 6, 23, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    padding: 2rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.refresh-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.refresh-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.2);
}

.refresh-btn.spinning svg {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.brand h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-pulse {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 4px;
    /* Square with slight roundness for a more architectural feel */
    box-shadow: 0 0 20px var(--primary);
    transform: rotate(45deg);
    animation: morph 4s infinite ease-in-out;
}

@keyframes morph {

    0%,
    100% {
        border-radius: 4px;
        transform: rotate(45deg);
    }

    50% {
        border-radius: 50%;
        transform: rotate(225deg);
        opacity: 0.7;
    }
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    text-align: right;
    flex: 1;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

/* --- Server Grid --- */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2.5rem;
    padding: 5rem 0;
    perspective: 1000px;
}

/* --- Card Design --- */
.server-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.6s cubic-bezier(0.23, 1, 0.32, 1),
        border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transform-style: preserve-3d;
}

.server-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    border-radius: inherit;
    pointer-events: none;
}

.server-card:hover {
    transform: translateY(-10px) rotateX(2deg) rotateY(-2deg);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(99, 102, 241, 0.15);
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.badge {
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-ssl {
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 15px var(--success-glow);
}

.badge-no-ssl {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.info-box {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 1px;
}

.info-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: #e2e8f0;
    word-break: break-all;
}

.title-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.name-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.server-favicon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.domain-label {
    opacity: 0.6;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--success);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.2);
    }
}

/* --- Footer --- */
.app-footer {
    margin-top: auto;
    padding: 4rem 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

#last-update {
    color: var(--accent);
    font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
}

@media (max-width: 768px) {
    .server-grid {
        grid-template-columns: 1fr;
        padding: 2rem 0;
    }

    .header-content {
        flex-direction: column;
        gap: 2rem;
    }

    .stats {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
}