/* Crown Bioscience Brand Colors */
:root {
    --primary-blue: #0066cc;
    --secondary-blue: #004c99;
    --accent-green: #00a651;
    --dark-bg: #1a1a2e;
    --light-bg: #f5f5f5;
    --text-dark: #333333;
    --text-light: #ffffff;
    --border-color: #e0e0e0;
    --ipsec-color: #0066cc;
    --sdwan-color: #00a651;
    --mpls-color: #ff6b35;
    --aws-color: #ff9900;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text-dark);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    color: var(--text-light);
    padding: 30px 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.control-panel {
    padding: 25px 40px;
    background: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.control-panel h3 {
    margin-bottom: 15px;
    color: var(--secondary-blue);
    font-size: 1.2em;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid var(--primary-blue);
    background: white;
    color: var(--primary-blue);
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn:hover {
    background: var(--primary-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.filter-btn.active {
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.network-map {
    padding: 40px;
    background: linear-gradient(135deg, #0a1929 0%, #1a2f42 50%, #243447 100%);
    position: relative;
    min-height: 700px;
}

#worldMap {
    width: 100%;
    height: auto;
    background: radial-gradient(ellipse at center, #1e2f42 0%, #0f1a28 100%);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

/* Node Styles */
.node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.node circle {
    transition: all 0.3s ease;
    filter: url(#dropShadow);
}

.node:hover circle {
    filter: url(#strongGlow);
    transform: scale(1.3);
}

.node.core circle {
    fill: #00ff88;
    stroke: #00cc6a;
    stroke-width: 4;
    filter: url(#glow);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.node.site circle {
    fill: #00d4ff;
    stroke: #0099cc;
    stroke-width: 3;
}

.node.cloud circle {
    fill: #ffa500;
    stroke: #ff8800;
    stroke-width: 3;
}

.node text {
    font-size: 14px;
    font-weight: 700;
    fill: #ffffff;
    pointer-events: none;
    text-anchor: middle;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 3px rgba(0, 0, 0, 1);
}

.node .location-label {
    font-size: 11px;
    fill: #c0d6e8;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 2px rgba(0, 0, 0, 1);
}

.node.highlighted circle {
    filter: url(#strongGlow);
    stroke-width: 5;
    transform: scale(1.2);
}

/* Connection Lines - Thinner and Clearer */
.connection {
    stroke-width: 1.5;
    fill: none;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.connection.ipsec {
    stroke: #00d4ff;
    stroke-dasharray: 6, 4;
}

.connection.sdwan {
    stroke: #00ff88;
    stroke-dasharray: 10, 5;
}

.connection.mpls {
    stroke: #ff6b6b;
    stroke-dasharray: none;
}

.connection.aws {
    stroke: #ffa500;
    stroke-dasharray: 4, 4;
}

.connection.highlighted {
    opacity: 1;
    stroke-width: 3;
    filter: url(#glow);
}

.connection.dimmed {
    opacity: 0.1;
}

/* Animated flow effect - Thinner */
.connection-flow {
    stroke: rgba(255, 255, 255, 0.95);
    stroke-width: 2;
    fill: none;
    opacity: 0;
    stroke-dasharray: 12, 200;
    animation: flow 2.5s linear infinite;
    filter: url(#glow);
}

@keyframes flow {
    0% {
        stroke-dashoffset: 0;
        opacity: 0;
    }
    20% {
        opacity: 0.9;
    }
    80% {
        opacity: 0.9;
    }
    100% {
        stroke-dashoffset: -212;
        opacity: 0;
    }
}

.connection.highlighted .connection-flow {
    opacity: 1;
    stroke-width: 2.5;
}

/* Info Panel */
.info-panel {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    padding: 25px 40px;
    background: white;
    border-top: 2px solid var(--border-color);
}

/* Legend */
.legend {}

.legend h3 {
    margin-bottom: 15px;
    color: var(--secondary-blue);
    font-size: 1.2em;
}

.legend-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95em;
}

.legend-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
}

.legend-icon.core {
    background: #00ff88;
    border: 2px solid #00cc6a;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}

.legend-icon.site {
    background: #00d4ff;
    border: 2px solid #0099cc;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.legend-icon.cloud {
    background: #ffa500;
    border: 2px solid #ff8800;
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.5);
}

.legend-line {
    width: 40px;
    height: 2px;
    display: inline-block;
}

.legend-line.ipsec {
    background: repeating-linear-gradient(
        to right,
        #00d4ff 0px,
        #00d4ff 6px,
        transparent 6px,
        transparent 10px
    );
}

.legend-line.sdwan {
    background: repeating-linear-gradient(
        to right,
        #00ff88 0px,
        #00ff88 10px,
        transparent 10px,
        transparent 15px
    );
}

.legend-line.mpls {
    background: #ff6b6b;
    height: 2px;
}

.legend-line.aws {
    background: repeating-linear-gradient(
        to right,
        #ffa500 0px,
        #ffa500 4px,
        transparent 4px,
        transparent 8px
    );
}

/* Tooltip */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 0.9em;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tooltip.show {
    opacity: 1;
}

/* Statistics */
.stats h3 {
    margin-bottom: 15px;
    color: var(--secondary-blue);
    font-size: 1.2em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
    border-radius: 8px;
    border: 1px solid #d0e4ff;
}

.stat-value {
    font-size: 2em;
    font-weight: 700;
    color: var(--primary-blue);
    line-height: 1;
}

.stat-label {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .filter-btn {
        width: 100%;
    }
    
    .info-panel {
        grid-template-columns: 1fr;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}