:root {
    /* Light Theme (Default) */
    --bg-main: #f0f4f8;
    --bg-card: rgba(255, 255, 255, 0.7);
    --border-color: rgba(0, 0, 0, 0.1);
    
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --accent: #0284c7;
    
    --text-main: #0f172a;
    --text-muted: #475569;
    
    --success: #059669;
    --error: #DC2626;

    --glass-blur: 12px;
    
    /* Theme specific */
    --input-bg: rgba(0, 0, 0, 0.05);
    --card-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    --prefix-bg: rgba(0, 0, 0, 0.05);
    --scrollbar-bg: rgba(0, 0, 0, 0.2);
    --hover-bg: rgba(0, 0, 0, 0.05);
    --btn-bg: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-main: #0a192f;
        --bg-card: rgba(255, 255, 255, 0.05);
        --border-color: rgba(255, 255, 255, 0.1);
        --accent: #06B6D4;
        
        --text-main: #F8FAFC;
        --text-muted: #94A3B8;
        
        --success: #10B981;
        --error: #EF4444;

        --input-bg: rgba(0, 0, 0, 0.2);
        --card-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
        --prefix-bg: rgba(255, 255, 255, 0.05);
        --scrollbar-bg: rgba(255, 255, 255, 0.2);
        --hover-bg: rgba(255, 255, 255, 0.05);
        --btn-bg: rgba(255, 255, 255, 0.1);
    }
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
}



/* Container */
.container {
    width: 100%;
    max-width: 900px;
    padding: 40px 20px;
    z-index: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.brand-logo {
    max-height: 50px;
    object-fit: contain;
}

.logo-container i {
    font-size: 2.5rem;
    color: var(--accent);
    background: -webkit-linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.subtitle strong {
    color: var(--text-main);
}

/* Glass Card Shared Style */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform: translateZ(0);
    will-change: transform;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Search Section */
.search-section {
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
}

.search-box {
    width: 100%;
    max-width: 500px;
}

.search-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.input-group {
    display: flex;
    align-items: stretch;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.prefix {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
}

input[type="number"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    padding: 12px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    background: var(--primary-hover);
}

button:active {
    transform: scale(0.98);
}

.error-msg {
    color: var(--error);
    margin-top: 8px;
    font-size: 0.9rem;
}

/* Results Section */
.results-section {
    animation: fadeIn 0.5s ease;
}

/* Loading */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.hidden {
    display: none !important;
}

/* Network Cards */
.network-cards {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 32px;
}

.network-card {
    text-align: center;
}

.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-header i {
    font-size: 2rem;
    color: var(--accent);
}

.card-logo {
    max-height: 40px;
    max-width: 150px;
    object-fit: contain;
    border-radius: 4px;
}

.host .card-header i {
    color: var(--primary);
}

.card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.card-body p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.connection-node {
    font-size: 2rem;
    color: var(--text-muted);
    opacity: 0.5;
    animation: pulse 2s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.3; }
    100% { transform: scale(1.1); opacity: 0.8; color: var(--accent); }
}

/* Mutual Points */
.mutual-points {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 32px;
}

.mutual-points.single-column {
    grid-template-columns: 1fr;
}

.mutual-points h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.mutual-points h3 i {
    color: var(--success);
}

.point-list {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 8px;
}

.point-list::-webkit-scrollbar {
    width: 6px;
}

.point-list::-webkit-scrollbar-thumb {
    background: var(--scrollbar-bg);
    border-radius: 10px;
}

.point-list li {
    background: var(--input-bg);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid var(--primary);
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.point-list li:hover {
    background: var(--hover-bg);
}

.point-list li input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.point-info {
    flex: 1;
}

.point-list li .name {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.point-list li .details {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.no-data {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

/* Action Area */
.action-area {
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.primary-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
    box-shadow: none;
}

.action-hint {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .network-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .connection-node {
        transform: rotate(90deg);
        margin: 10px 0;
    }
    .mutual-points {
        grid-template-columns: 1fr;
    }
}

/* BGP Config Area */
.bgp-config-area {
    margin-top: 40px;
    animation: fadeIn 0.5s ease;
}

.bgp-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.bgp-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 8px;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 8px;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

pre {
    background: #000;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #4ade80; /* matrix green */
    border: 1px solid rgba(255,255,255,0.05);
}

/* Language Toggle */
.lang-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.lang-btn {
    background: var(--btn-bg);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.2);
}

.lang-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

/* SLA Notice */
.sla-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(6, 182, 212, 0.1);
    border-left: 4px solid var(--accent);
    margin-bottom: 32px;
    padding: 16px;
}

.sla-notice i {
    font-size: 1.5rem;
    color: var(--accent);
    margin-top: 2px;
}

.sla-notice p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}
