:root {
    --bg-color: #050b14;
    --text-primary: #e0f2fe;
    --text-secondary: #7dd3fc;
    
    --cyber-bg: rgba(5, 15, 30, 0.8);
    --cyber-border: rgba(0, 229, 255, 0.3);
    --cyber-glow: 0 0 15px rgba(0, 229, 255, 0.2), inset 0 0 20px rgba(0, 229, 255, 0.05);
    
    --primary-color: #00e5ff;
    --primary-hover: #00b8cc;
    --secondary-color: rgba(0, 229, 255, 0.1);
    --secondary-hover: rgba(0, 229, 255, 0.2);
    
    --status-checking: #7dd3fc;
    --status-fast: #39ff14; /* Neon Green */
    --status-medium: #ffb300; /* Amber Glow */
    --status-slow: #ff003c; /* Cyber Red */
    --status-offline: #475569;
    
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* Cyber Grid Background */
.cyber-glow {
    position: fixed;
    filter: blur(120px);
    border-radius: 50%;
    opacity: 0.3;
    z-index: -3;
    animation: pulseGlow 15s infinite alternate;
}

.glow-1 {
    top: -10%; left: -10%;
    width: 60vw; height: 60vw;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 60%);
    animation-delay: 0s;
}

.glow-2 {
    bottom: -20%; right: -10%;
    width: 70vw; height: 70vw;
    background: radial-gradient(circle, #b900ff 0%, transparent 60%); /* Cyber Purple */
    animation-duration: 20s;
    animation-delay: -5s;
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.2; }
    100% { transform: scale(1.2); opacity: 0.4; }
}

.cyber-grid {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -2;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) scale(2);
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 30px; }
}

/* HUD Abstract Elements */
.hud-elements {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.hud-circle {
    position: absolute;
    border-radius: 50%;
    animation: spin linear infinite;
}

.hc-1 {
    width: 70vw; height: 70vw;
    top: -35vw; right: -25vw;
    border: 2px dashed rgba(0, 229, 255, 0.15);
    border-top: 2px solid rgba(0, 229, 255, 0.4);
    border-bottom: 2px solid rgba(0, 229, 255, 0.4);
    animation-duration: 60s;
}

.hc-2 {
    width: 90vw; height: 90vw;
    bottom: -45vw; left: -35vw;
    border: 1px dashed rgba(185, 0, 255, 0.1);
    border-left: 2px solid rgba(185, 0, 255, 0.3);
    animation-duration: 90s;
    animation-direction: reverse;
}

.hc-3 {
    width: 40vw; height: 40vw;
    top: 20vh; left: 30vw;
    border: 1px dotted rgba(0, 229, 255, 0.1);
    animation-duration: 40s;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Data Particles */
.cyber-particles {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px; height: 3px;
    background: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-color), 0 0 15px var(--primary-color);
    border-radius: 50%;
    animation: dataStream linear infinite;
    opacity: 0.6;
}

.particle::before {
    content: '';
    position: absolute;
    top: -30px; left: 50%;
    transform: translateX(-50%);
    width: 1px; height: 30px;
    background: linear-gradient(to top, var(--primary-color), transparent);
}

.p1 { left: 15%; bottom: -5%; animation-duration: 12s; animation-delay: 0s; }
.p2 { left: 35%; bottom: -5%; animation-duration: 18s; animation-delay: -5s; width: 4px; height: 4px; }
.p3 { left: 55%; bottom: -5%; animation-duration: 15s; animation-delay: -2s; background: #b900ff; box-shadow: 0 0 8px #b900ff; }
.p3::before { background: linear-gradient(to top, #b900ff, transparent); }
.p4 { left: 75%; bottom: -5%; animation-duration: 20s; animation-delay: -8s; width: 2px; height: 2px; }
.p5 { left: 85%; bottom: -5%; animation-duration: 14s; animation-delay: -12s; }
.p6 { left: 45%; bottom: -5%; animation-duration: 22s; animation-delay: -15s; width: 5px; height: 5px; opacity: 0.3; }
.p7 { left: 5%; bottom: -5%; animation-duration: 17s; animation-delay: -7s; }

@keyframes dataStream {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(-120vh); opacity: 0; }
}

.scanlines {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.1) 50%,
        rgba(0,0,0,0.1)
    );
    background-size: 100% 4px;
    z-index: -1;
    pointer-events: none;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
    text-transform: uppercase;
}

header h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 12px;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.8), 0 0 20px rgba(0, 229, 255, 0.4);
    letter-spacing: 2px;
}

header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* IP Badge */
.ip-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    margin-bottom: 16px;
    font-size: 1rem;
    font-family: var(--font-mono);
    color: var(--primary-color);
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.ip-label {
    opacity: 0.8;
}

.ip-value {
    font-weight: bold;
    text-shadow: 0 0 5px var(--primary-color);
}

/* Cyber Panels */
.cyber-panel {
    background: var(--cyber-bg);
    border: 1px solid var(--cyber-border);
    box-shadow: var(--cyber-glow);
    padding: 24px;
    position: relative;
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    transition: all var(--transition-normal);
}

.cyber-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 20px; height: 20px;
    border-top: 2px solid var(--primary-color);
    border-left: 2px solid var(--primary-color);
}
.cyber-panel::after {
    content: '';
    position: absolute;
    bottom: 0; right: 0;
    width: 20px; height: 20px;
    border-bottom: 2px solid var(--primary-color);
    border-right: 2px solid var(--primary-color);
}

.highlight-panel {
    border-color: rgba(57, 255, 20, 0.5);
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.15), inset 0 0 20px rgba(57, 255, 20, 0.05);
}
.highlight-panel::before, .highlight-panel::after {
    border-color: var(--status-fast);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.pulse-indicator {
    width: 12px;
    height: 12px;
    background-color: var(--status-fast);
    box-shadow: 0 0 10px var(--status-fast);
    animation: cyberPulse 1.5s infinite alternate;
}

@keyframes cyberPulse {
    0% { opacity: 0.5; box-shadow: 0 0 5px var(--status-fast); }
    100% { opacity: 1; box-shadow: 0 0 15px var(--status-fast), 0 0 25px var(--status-fast); }
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--status-fast);
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.5);
    letter-spacing: 2px;
}

.fastest-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fastest-content .node-url {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 8px rgba(255,255,255,0.5);
    word-break: break-all;
}

.fastest-content .node-latency {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--status-fast);
    text-shadow: 0 0 5px var(--status-fast);
}

/* Sections */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.3);
    padding-bottom: 10px;
}

.section-title h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: 0 0 5px rgba(0, 229, 255, 0.2);
}

.icon-btn:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 15px var(--primary-color);
}

.nodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

#common-nodes-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.node-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#common-nodes-grid .node-card {
    padding: 15px 10px;
    align-items: center;
    text-align: center;
    gap: 8px;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
#common-nodes-grid .node-card::before {
    width: 10px; height: 10px; border-width: 1px;
}
#common-nodes-grid .node-card::after {
    width: 10px; height: 10px; border-width: 1px;
}

.node-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--status-checking);
}

.node-url {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: bold;
    word-break: break-all;
}

#common-nodes-grid .node-url {
    font-size: 1rem;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.node-latency {
    font-family: var(--font-mono);
    font-size: 1rem;
}

.node-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

#common-nodes-grid .node-actions {
    display: none;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    flex: 1;
    position: relative;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #000;
    box-shadow: 0 0 10px var(--primary-color);
}

.btn-primary:hover {
    background-color: #fff;
    box-shadow: 0 0 20px #fff;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: rgba(0, 229, 255, 0.2);
    box-shadow: inset 0 0 10px rgba(0, 229, 255, 0.5);
}

.btn.copied {
    background-color: var(--status-fast);
    color: #000;
    box-shadow: 0 0 10px var(--status-fast);
    border-color: var(--status-fast);
}

/* Status Colors */
.status-checking .status-indicator { background-color: var(--status-checking); box-shadow: 0 0 5px var(--status-checking); }
.status-fast .status-indicator { background-color: var(--status-fast); box-shadow: 0 0 8px var(--status-fast); }
.status-medium .status-indicator { background-color: var(--status-medium); box-shadow: 0 0 8px var(--status-medium); }
.status-slow .status-indicator { background-color: var(--status-slow); box-shadow: 0 0 8px var(--status-slow); }
.status-offline .status-indicator { background-color: var(--status-offline); }

.status-fast { border-color: rgba(57, 255, 20, 0.3); }
.status-medium { border-color: rgba(255, 179, 0, 0.3); }
.status-slow { border-color: rgba(255, 0, 60, 0.3); }

.status-fast .latency-value { color: var(--status-fast); text-shadow: 0 0 5px var(--status-fast); }
.status-medium .latency-value { color: var(--status-medium); text-shadow: 0 0 5px var(--status-medium); }
.status-slow .latency-value { color: var(--status-slow); text-shadow: 0 0 5px var(--status-slow); }
.status-offline .latency-value { color: var(--status-offline); }

/* Footer */
footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: var(--font-mono);
}

.disclaimer {
    margin-top: 8px;
    color: var(--status-medium);
    text-shadow: 0 0 5px rgba(255, 179, 0, 0.5);
}

.loading-state {
    color: var(--primary-color);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    0% { opacity: 0.5; }
    100% { opacity: 1; text-shadow: 0 0 10px var(--primary-color); }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 5, 15, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary-color);
    letter-spacing: 1px;
}

#common-nodes-grid .node-card {
    cursor: pointer;
}

/* Responsive */
@media (max-width: 900px) {
    #common-nodes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }
    .nodes-grid {
        grid-template-columns: 1fr;
    }
    #common-nodes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .fastest-content .node-url {
        font-size: 1.4rem;
    }
    .cyber-grid {
        transform: perspective(500px) rotateX(60deg) translateY(-50px) scale(3);
    }
}
