/* ============================================
   SERVERS PAGE — OnlyQVPN
   Infrastructure status & monitoring
   ============================================ */

.servers-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 80px 6vw 120px;
}

/* ── Header ── */
.servers-header {
    margin-bottom: 40px;
}

.servers-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(36px, 5vw, 48px);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.servers-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'Space Mono', monospace;
}

/* ── Status banner ── */
.status-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 40px;
    border: 1px solid;
}

.status-banner-ok {
    background: rgba(200, 255, 87, 0.07);
    border-color: rgba(200, 255, 87, 0.2);
    color: var(--accent);
}

.status-banner-degraded {
    background: rgba(255, 200, 87, 0.07);
    border-color: rgba(255, 200, 87, 0.2);
    color: #ffc857;
}

.status-banner-error {
    background: rgba(255, 77, 77, 0.07);
    border-color: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
}

.status-banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    animation: statusPulse 2.5s ease-in-out infinite;
}

.status-banner-ok .status-banner-dot   { background: var(--accent); }
.status-banner-degraded .status-banner-dot { background: #ffc857; }
.status-banner-error .status-banner-dot { background: #ff4d4d; }

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}

/* ── Section title ── */
.servers-section-title {
    font-family: 'Syne', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.servers-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Node grid ── */
.nodes-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Node card ── */
.node-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 22px 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.node-card-online {
    border-color: rgba(200, 255, 87, 0.15);
}

.node-card-online:hover {
    border-color: rgba(200, 255, 87, 0.35);
    box-shadow: var(--glow-green);
}

.node-card-offline {
    border-color: rgba(255, 77, 77, 0.15);
    opacity: 0.7;
}

.node-card-connecting {
    border-color: rgba(255, 200, 87, 0.15);
}

/* Card header: status dot + name */
.node-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.node-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.node-pulse-online {
    background: var(--accent);
    animation: nodePulse 2.4s ease-in-out infinite;
}

.node-pulse-offline {
    background: #ff4d4d;
}

.node-pulse-connecting {
    background: #ffc857;
    animation: nodePulse 1.2s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(200, 255, 87, 0.6); }
    50%       { box-shadow: 0 0 0 6px rgba(200, 255, 87, 0); }
}

.node-name {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-status-pill {
    font-size: 10px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: 12px;
    flex-shrink: 0;
}

.pill-online    { background: rgba(200,255,87,0.12); color: var(--accent); border: 1px solid rgba(200,255,87,0.25); }
.pill-offline   { background: rgba(255,77,77,0.12);  color: #ff4d4d;       border: 1px solid rgba(255,77,77,0.25); }
.pill-connecting{ background: rgba(255,200,87,0.12); color: #ffc857;       border: 1px solid rgba(255,200,87,0.25); }
.pill-unknown   { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }

/* Meta row: country + protocol */
.node-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.node-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.node-meta-badge-proto {
    background: rgba(0,180,255,0.06);
    color: #00b4ff;
    border-color: rgba(0,180,255,0.2);
}

/* Version */
.node-version-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
}

/* Hardware stats grid */
.node-hw-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 10px;
    margin-bottom: 4px;
}
.node-hw-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
}
.node-hw-item svg { flex-shrink: 0; opacity: 0.7; }

/* Load bar */
.node-load-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

.node-load-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.node-load-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, rgba(200, 255, 87, 0.6) 100%);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.node-load-label {
    font-size: 10px;
    font-family: 'Space Mono', monospace;
    color: var(--text-muted);
    min-width: 28px;
}
.node-load-text {
    font-size: 10px;
    font-family: 'Space Mono', monospace;
    color: var(--text-muted);
    min-width: 35px;
    text-align: right;
}

/* HOST badge */
.node-host-badge {
    font-size: 9px;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    letter-spacing: 0.1em;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(200,255,87,0.1);
    color: var(--accent);
    border: 1px solid rgba(200,255,87,0.3);
    flex-shrink: 0;
}

/* Simple status line at bottom of card */
.node-status-line {
    height: 2px;
    border-radius: 2px;
    background: rgba(200, 255, 87, 0.25);
    margin-top: 2px;
}

.node-status-line-off {
    background: rgba(255, 77, 77, 0.2);
}

/* Error message */
.node-error-msg {
    font-size: 11px;
    color: #ff4d4d;
    font-family: 'Space Mono', monospace;
    word-break: break-word;
    line-height: 1.5;
}

/* ── Error state ── */
.servers-error {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.servers-error-icon {
    margin-bottom: 16px;
    opacity: 0.4;
}

.servers-error-title {
    font-family: 'Syne', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ── Footer note ── */
.servers-footer-note {
    margin-top: 48px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'Space Mono', monospace;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .system-stats { grid-template-columns: repeat(2, 1fr); }
    .nodes-grid   { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .system-stats { grid-template-columns: 1fr 1fr; }
}
