/* styles.css */

/* Custom Properties */
:root {
    --lan-color: #00c853;
    --vpn-color: #ff9800;
    --highlight-color: yellowgreen;
    --bg-dark: #1e1e1e;
    --bg-light: #2a2a2a;
    --node-size: 10;
    --text-color: #e8e8e8;
}

/* Animations */
@keyframes dash {
    to {
        stroke-dashoffset: -18;
    }
}



/* SVG Container Styles */
svg {
    background-color: var(--bg-light);
    width: 100%;
    height: auto;
    max-height: 80vh;
    /* Limit height to fit within viewport */
}

/* Link Styles */
.link {
    stroke: var(--lan-color);
    stroke-width: 1.5;
    stroke-dasharray: 6, 12;
    animation: dash 2s linear infinite;
    opacity: 0.5;
    transition: stroke 0.3s, opacity 0.3s;
}

.vpn-link {
    stroke: var(--vpn-color);
    stroke-width: 2.5;
    stroke-dasharray: 8, 16;
    animation: dash 3s linear infinite;
    opacity: 1;
}

.active-link {
    stroke: var(--lan-color);
    stroke-width: 1.5;
    stroke-dasharray: 6, 12;
    animation: dash 2s linear infinite;
    opacity: 0.95;
}

.highlighted {
    stroke: var(--highlight-color);
    stroke-width: 3;
    animation: none;
}

/* Label Styles */
.label-bg {
    fill: rgba(30, 30, 30, 0.85);
    stroke: var(--lan-color);
    stroke-width: 2;
    rx: 8;
    transition: fill 0.3s, stroke 0.3s;
}

.label {
    fill: #f0f0f0;
    font-size: 0.75rem;
    text-anchor: middle;
    pointer-events: none;
    font-weight: 500;
}

/* Node Styles */
.node {
    stroke: var(--lan-color);
    stroke-width: 2;
    fill: var(--bg-dark);
    transition: fill 0.3s, stroke 0.3s;
    cursor: pointer;
    opacity: 0.8;
}

.node:hover {
    fill: #2a2a2a;
}

.connected {
    fill: rgba(76, 175, 80, 0.6);
    stroke-width: 4;
}

.ai-node {
    animation: pulse 2s infinite;
    transform-origin: center;
}

/* Info Panel Styles */
#info {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 350px;
    padding: 1rem;
    background: #252526;
    border: 2px solid var(--lan-color);
    border-radius: 0.375rem;
    color: var(--text-color);
    display: none;
    z-index: 10;
}

/* Ping Output and Button Styles */
#ping-output {
    background: #252526;
    border: 1px solid #3c3c3c;
    border-radius: 0.375rem;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    overflow-x: auto;
    min-height: 100px;
    /* Ensure container has visible height */
}

#run-ping {
    background-color: var(--lan-color);
    color: #1e1e1e;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.3s;
}

#run-ping:hover {
    background-color: #00e676;
}

/* Responsive Styles */
@media (max-width: 640px) {
    #info {
        width: 90%;
        right: 5%;
        top: 0.5rem;
    }

    .label {
        font-size: 0.65rem;
    }

    :root {
        --node-size: 8;
    }

    svg {
        max-height: 60vh;
        /* Smaller height for mobile */
    }

    /* styles.css (unchanged, partial) */

    /* Ping Output Styles */
    #ping-output {
        background: #252526;
        border: 1px solid #3c3c3c;
        border-radius: 0.375rem;
        padding: 1rem;
        font-family: 'Courier New', monospace;
        white-space: pre-wrap;
        overflow-x: auto;
    }
}