/* Custom styles to complement Bootstrap - Fiber Optics Theme */

/* Auto-connected device highlight styles */
.auto-connected.house-count-circle {
    border: 3px solid #2ecc71 !important;
    box-shadow: 0 0 10px #2ecc71, 0 0 15px rgba(46, 204, 113, 0.5) !important;
    animation: auto-connect-pulse 1.5s infinite alternate !important;
}

.auto-connected.zero-count-circle {
    border: 3px solid #2ecc71 !important;
    box-shadow: 0 0 10px #2ecc71, 0 0 15px rgba(46, 204, 113, 0.5) !important;
    animation: auto-connect-pulse 1.5s infinite alternate !important;
}

.auto-connected.fa-map-marker-alt {
    color: #2ecc71 !important;
    text-shadow: 0 0 10px #2ecc71, 0 0 15px rgba(46, 204, 113, 0.5) !important;
    animation: auto-connect-pulse 1.5s infinite alternate !important;
}

/* Already-grouped device highlight styles */
.already-grouped.house-count-circle {
    border: 3px solid #e74c3c !important;
    box-shadow: 0 0 10px #e74c3c, 0 0 15px rgba(231, 76, 60, 0.5) !important;
    animation: already-grouped-pulse 1.5s infinite alternate !important;
}

.already-grouped.zero-count-circle {
    border: 3px solid #e74c3c !important;
    box-shadow: 0 0 10px #e74c3c, 0 0 15px rgba(231, 76, 60, 0.5) !important;
    animation: already-grouped-pulse 1.5s infinite alternate !important;
}

.already-grouped.fa-map-marker-alt {
    color: #e74c3c !important;
    text-shadow: 0 0 10px #e74c3c, 0 0 15px rgba(231, 76, 60, 0.5) !important;
    animation: already-grouped-pulse 1.5s infinite alternate !important;
}

@keyframes auto-connect-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

@keyframes already-grouped-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.15);
        opacity: 0.8;
    }
}

/* Max distance path styling */
.max-distance-path {
    filter: drop-shadow(0 0 5px #2ecc71) drop-shadow(0 0 8px rgba(46, 204, 113, 0.6));
    animation: max-distance-pulse 2s infinite alternate;
}

@keyframes max-distance-pulse {
    0% {
        filter: drop-shadow(0 0 4px #2ecc71) drop-shadow(0 0 6px rgba(46, 204, 113, 0.6));
    }
    100% {
        filter: drop-shadow(0 0 6px #2ecc71) drop-shadow(0 0 10px rgba(46, 204, 113, 0.8));
    }
}

/* Fiber Detail Styles for Terminator Display */
.fiber-detail {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 5px 8px;
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.fiber-detail:hover {
    background-color: rgba(0, 0, 0, 0.2);
    transform: translateX(3px);
}

.fiber-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 5px;
    border: 1px solid rgba(0,0,0,0.2);
    box-shadow: 0 0 4px rgba(255,255,255,0.2);
}

.fiber-number {
    font-family: monospace;
    font-size: 12px;
    width: 35px;
    display: inline-block;
    color: white;
    text-align: right;
}

.fiber-tag {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* First column - tube tag */
.tube-tag {
    width: 95px;
    margin-right: 10px;
}

/* Style for the terminator badge - T01, T02, etc. */
.terminator-badge {
    display: inline-block;
    padding: 3px 8px;
    margin-right: 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    background: #555555 !important; /* Neutral gray background - important to override other styles */
    color: white;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Glowing yellow style for SPARE fiber indicators */
.fiber-indicator.spare-indicator {
    background-color: #ffeb3b !important; /* Bright yellow */
    box-shadow: 0 0 6px rgba(255, 235, 59, 0.8) !important;
    border: 1px solid rgba(255, 215, 0, 0.5) !important;
}

/* Style for the SPARE badges and future fiber indicators */
.spare-badge, .future-fiber-badge, .badge.bg-warning {
    background-color: #ffc107 !important; 
    box-shadow: 0 0 8px rgba(255, 193, 7, 0.7) !important; 
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3) !important;
    color: #212529 !important;
    border: 1px solid rgba(255, 215, 0, 0.5) !important;
    transition: all 0.2s ease;
}

/* Hover effect for clickable badges */
.clipboard-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.9) !important;
    cursor: pointer;
}

/* SXX badge hover effect */
.badge:hover {
    cursor: pointer;
}
.badge[class*="s0"]:hover,
.badge[class*="s1"]:hover,
.badge[class*="s2"]:hover,
.badge[class*="s3"]:hover,
.badge[class*="s4"]:hover,
.badge[class*="s5"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5) !important;
    transition: all 0.2s ease;
}

/* Flash effect when copied */
@keyframes clipboard-flash {
    0% { background-color: #ffc107; }
    50% { background-color: #ffffff; }
    100% { background-color: #ffc107; }
}

/* Flash effect for SXX badges when copied */
@keyframes clipboard-flash-sxx {
    0% { background-color: #8e44ad; }
    50% { background-color: #ffffff; color: #000000 !important; }
    100% { background-color: #8e44ad; }
}

.clipboard-flash {
    animation: clipboard-flash 0.5s ease;
}

/* SXX badges with hover and flash effects */
.badge:has(+ .tooltip-sxx),
.badge:has(~ .tooltip-sxx) {
    cursor: pointer !important;
}

/* Apply flash animation for SXX badges */
.badge.clipboard-flash[class*="s0"],
.badge.clipboard-flash[class*="s1"],
.badge.clipboard-flash[class*="s2"],
.badge.clipboard-flash[class*="s3"],
.badge.clipboard-flash[class*="s4"],
.badge.clipboard-flash[class*="s5"] {
    animation: clipboard-flash-sxx 0.5s ease !important;
}

/* Apply purple styling to all SXX badges */
.badge[class*="s0"],
.badge[class*="s1"],
.badge[class*="s2"],
.badge[class*="s3"],
.badge[class*="s4"],
.badge[class*="s5"] {
    background: #8e44ad !important;
    color: white !important;
    font-size: 13px !important;
    letter-spacing: 0.7px !important;
    box-shadow: 0 0 8px rgba(161, 90, 242, 0.5) !important;
    transition: all 0.3s ease !important;
}

/* Hover effect for SXX badges */
.badge[class*="s0"]:hover,
.badge[class*="s1"]:hover,
.badge[class*="s2"]:hover,
.badge[class*="s3"]:hover,
.badge[class*="s4"]:hover,
.badge[class*="s5"]:hover {
    box-shadow: 0 0 12px rgba(161, 90, 242, 0.8) !important;
    transform: translateY(-1px) !important;
}

/* Neutral styling for all terminator badges with class names like t01-badge, t02-badge, etc. */
.t01-badge, .t02-badge, .t03-badge, .t04-badge, .t05-badge,
.t06-badge, .t07-badge, .t08-badge, .t09-badge, .t10-badge,
.t11-badge, .t12-badge, .t13-badge, .t14-badge, .t15-badge,
.t16-badge, .t17-badge, .t18-badge, .t19-badge, .t20-badge,
.t21-badge, .t22-badge, .t23-badge, .t24-badge, .t25-badge,
.t26-badge, .t27-badge, .t28-badge, .t29-badge, .t30-badge,
.t31-badge, .t32-badge, .t33-badge, .t34-badge, .t35-badge,
.t36-badge, .t37-badge, .t38-badge, .t39-badge, .t40-badge,
.t41-badge {
    background: #555555 !important;
    color: white !important;
}

:root {
    /* Core fiber optic colors - refined */
    --fiber-glow-primary: rgba(0, 195, 255, 0.7);
    --fiber-glow-secondary: rgba(51, 89, 255, 0.6);
    --fiber-accent-blue: #00b3ff;
    --fiber-accent-purple: #7e34ca;
    --fiber-dark-blue: #051a30;
    --fiber-card-bg: rgba(22, 28, 40, 0.85);
    --fiber-glass-effect: rgba(30, 38, 55, 0.75);
    
    /* Sophisticated earthy tones palette */
    --fiber-earth-brown: #5d4037;
    --fiber-deep-brown: #3e2723;
    --fiber-warm-clay: #8d6e63;
    --fiber-copper: #bf794e;
    --fiber-forest-green: #2e7d32;
    --fiber-moss-green: #558b2f;
    --fiber-sage: #7cb342;
    --fiber-clay: #a1887f;
    --fiber-sand: #d7ccc8;
    --fiber-slate: #607d8b;
    --fiber-stone: #455a64;
    
    /* Enhanced light transmission accents */
    --fiber-light-glow: rgba(255, 255, 255, 0.25);
    --fiber-light-bright: rgba(255, 255, 255, 0.95);
    --fiber-light-pulse: rgba(104, 220, 255, 0.8);
    --fiber-light-trail: rgba(230, 255, 250, 0.35);
    --fiber-light-soft: rgba(200, 240, 255, 0.2);
    --fiber-light-teal: rgba(80, 220, 180, 0.6);
    --fiber-light-gold: rgba(255, 215, 0, 0.5);
    
    /* UI Components - refined */
    --fiber-nav-bg: rgba(16, 26, 44, 0.95);
    --fiber-nav-border: rgba(0, 195, 255, 0.15);
    --fiber-nav-item-hover: rgba(0, 195, 255, 0.1);
    --fiber-dropdown-bg: rgba(13, 22, 36, 0.97);
    
    /* Text and typography */
    --fiber-text-primary: rgba(255, 255, 255, 0.95);
    --fiber-text-secondary: rgba(255, 255, 255, 0.75);
    --fiber-text-tertiary: rgba(255, 255, 255, 0.6);
    --fiber-text-info: rgba(160, 220, 255, 0.9);
    
    /* Gradients */
    --fiber-gradient-blue: linear-gradient(135deg, #0288d1, #01579b);
    --fiber-gradient-purple: linear-gradient(135deg, #7b1fa2, #4a148c);
    --fiber-gradient-teal: linear-gradient(135deg, #00897b, #004d40);
    --fiber-gradient-dark: linear-gradient(135deg, #263238, #0d1b24);
    
    /* Status colors */
    --fiber-status-success: #4caf50;
    --fiber-status-warning: #ff9800;
    --fiber-status-danger: #f44336;
    --fiber-status-info: #2196f3;
}

/* Global Gaussian blur effects */
.gaussian-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Map container */
#map-container {
    position: relative;
    height: calc(100vh - 240px);
    min-height: 500px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 15px var(--fiber-glow-primary), 0 0 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 195, 255, 0.2);
    z-index: 1;
}

#map {
    height: 100%;
    width: 100%;
    background-color: var(--fiber-dark-blue); /* Dark background with blue tint */
}

/* Make sure map container pushes to full width */
.row > .col-12 {
    padding-left: 0;
    padding-right: 0;
}

/* Make the main container take full width */
main.container {
    max-width: 100%;
    padding-left: 12px;
    padding-right: 12px;
}

/* Map toolbar styling */
.map-toolbar, .map-metrics-toolbar {
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0, 195, 255, 0.2);
    border: 1px solid rgba(0, 195, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background-color: var(--fiber-glass-effect) !important;
    transition: box-shadow 0.3s ease;
    position: relative;
    z-index: 1050;
}

.map-toolbar:hover, .map-metrics-toolbar:hover {
    box-shadow: 0 0 20px rgba(0, 195, 255, 0.3);
}

/* Compact Fiber Metrics Panel */
.compact-metrics-panel {
    background: var(--fiber-glass-effect);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25), 0 0 10px rgba(0, 195, 255, 0.1);
    border: 1px solid rgba(0, 195, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    overflow: hidden;
    animation: subtle-glow 3s infinite ease-in-out;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    margin: 0;
}

.compact-metrics-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 195, 255, 0.05), transparent);
    animation: fiber-scan 12s infinite linear;
    pointer-events: none;
}

.metrics-container {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.metric-group {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.metric-group:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom, transparent, rgba(0, 195, 255, 0.3), transparent);
}

.compact-metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 45px;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(8, 20, 35, 0.4);
    border: 1px solid rgba(0, 195, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.compact-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 195, 255, 0.4), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.compact-metric:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 12px rgba(0, 195, 255, 0.3);
    border-color: rgba(0, 195, 255, 0.3);
}

.compact-metric:hover::before {
    opacity: 1;
}

.compact-metric .metric-icon {
    font-size: 14px;
    color: var(--fiber-accent-blue);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.compact-metric:hover .metric-icon {
    transform: scale(1.1);
    opacity: 1;
    color: white;
    filter: drop-shadow(0 0 5px rgba(0, 195, 255, 0.5));
}

.compact-metric .metric-value {
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    line-height: 1;
}

.compact-metric:hover .metric-value {
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    transform: scale(1.05);
}

.compact-metric .metric-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1;
}

/* Color-coded metric groups */
.primary-metrics .compact-metric:nth-child(1) {
    border-color: rgba(79, 195, 247, 0.3);
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15), rgba(79, 195, 247, 0.1));
}

.primary-metrics .compact-metric:nth-child(2) {
    border-color: rgba(102, 187, 106, 0.3);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(102, 187, 106, 0.1));
}

.primary-metrics .compact-metric:nth-child(3) {
    border-color: rgba(255, 183, 77, 0.3);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 183, 77, 0.1));
}

.primary-metrics .compact-metric:nth-child(4) {
    border-color: rgba(171, 71, 188, 0.3);
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.15), rgba(171, 71, 188, 0.1));
}

.secondary-metrics .compact-metric {
    border-color: rgba(96, 125, 139, 0.3);
    background: linear-gradient(135deg, rgba(69, 90, 100, 0.15), rgba(96, 125, 139, 0.1));
}

/* Special styling for summary metrics */
.summary-metrics .compact-metric.utilization {
    border-color: rgba(139, 195, 74, 0.3);
    background: linear-gradient(135deg, rgba(124, 179, 66, 0.15), rgba(139, 195, 74, 0.1));
}

.summary-metrics .compact-metric.grand-total,
.summary-metrics .compact-metric.plus2-total {
    border-color: rgba(255, 215, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 215, 0, 0.15));
    font-weight: bold;
    border-width: 2px;
}

.summary-metrics .compact-metric.grand-total .metric-value,
.summary-metrics .compact-metric.plus2-total .metric-value {
    font-size: 18px;
    font-weight: 800;
}

.metrics-actions {
    display: flex;
    align-items: center;
    margin-left: 16px;
}

.compact-refresh-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(22, 28, 40, 0.7);
    border: 1px solid rgba(0, 195, 255, 0.2);
    color: var(--fiber-accent-blue);
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    padding: 0;
    cursor: pointer;
}

.compact-refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 195, 255, 0.2);
    background: rgba(0, 195, 255, 0.1);
    border-color: rgba(0, 195, 255, 0.4);
    color: white;
}

/* Animation for metric updates */
@keyframes compact-metric-flash {
    0% { 
        background: linear-gradient(135deg, rgba(0, 195, 255, 0.3), rgba(0, 195, 255, 0.1));
        transform: scale(1);
    }
    50% { 
        background: linear-gradient(135deg, rgba(0, 195, 255, 0.5), rgba(0, 195, 255, 0.3));
        transform: scale(1.1);
    }
    100% { 
        background: linear-gradient(135deg, rgba(0, 195, 255, 0.3), rgba(0, 195, 255, 0.1));
        transform: scale(1);
    }
}

.compact-metric.flash-update {
    animation: compact-metric-flash 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Responsive design */
@media (max-width: 1200px) {
    .metrics-container {
        gap: 15px;
    }
    
    .metric-group {
        gap: 8px;
    }
    
    .compact-metric {
        min-width: 40px;
        padding: 3px 5px;
    }
    
    .compact-metric .metric-value {
        font-size: 14px;
    }
    
    .compact-metric .metric-label {
        font-size: 8px;
    }
}

@media (max-width: 768px) {
    .compact-metrics-panel {
        flex-direction: column;
        gap: 12px;
        padding: 10px 12px;
    }
    
    .metrics-container {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .metric-group {
        justify-content: space-between;
        width: 100%;
        gap: 6px;
    }
    
    .metric-group::after {
        display: none;
    }
    
    .compact-metric {
        flex: 1;
        min-width: 0;
    }
    
    .metrics-actions {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
}

/* Remove old fiber-metrics-panel styles to avoid conflicts */
.fiber-metrics-panel {
    display: none !important;
}

.fiber-metric-item {
    display: flex;
    align-items: center;
    margin: 0;
    position: relative;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(8, 20, 35, 0.6);
    border: 1px solid rgba(0, 225, 255, 0.1);
    transition: all 0.3s ease;
    min-width: 70px;
}

/* Color-coded metric items */
.fiber-metric-item:nth-child(1) {
    border-color: rgba(79, 195, 247, 0.4);
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15), rgba(79, 195, 247, 0.1));
}

.fiber-metric-item:nth-child(2) {
    border-color: rgba(102, 187, 106, 0.4);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(102, 187, 106, 0.1));
}

.fiber-metric-item:nth-child(3) {
    border-color: rgba(255, 183, 77, 0.4);
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 183, 77, 0.1));
}

.fiber-metric-item:nth-child(4) {
    border-color: rgba(171, 71, 188, 0.4);
    background: linear-gradient(135deg, rgba(156, 39, 176, 0.15), rgba(171, 71, 188, 0.1));
}

.fiber-metric-item:nth-child(5) {
    border-color: rgba(240, 98, 146, 0.4);
    background: linear-gradient(135deg, rgba(233, 30, 99, 0.15), rgba(240, 98, 146, 0.1));
}

.fiber-metric-item:nth-child(6) {
    border-color: rgba(255, 112, 67, 0.4);
    background: linear-gradient(135deg, rgba(255, 87, 34, 0.15), rgba(255, 112, 67, 0.1));
}

.fiber-metric-item:nth-child(7) {
    border-color: rgba(139, 195, 74, 0.4);
    background: linear-gradient(135deg, rgba(124, 179, 66, 0.15), rgba(139, 195, 74, 0.1));
}

.fiber-metric-item:nth-child(8) {
    border-color: rgba(96, 125, 139, 0.4);
    background: linear-gradient(135deg, rgba(69, 90, 100, 0.15), rgba(96, 125, 139, 0.1));
}

/* Special styling for grand totals */
.fiber-metric-item:nth-child(9), .fiber-metric-item:nth-child(10) {
    border-color: rgba(255, 215, 0, 0.5);
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2), rgba(255, 215, 0, 0.15));
    font-weight: bold;
    border-width: 2px;
}

.fiber-metric-item:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 12px rgba(0, 195, 255, 0.3);
    background-opacity: 0.8;
}

.fiber-metric-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    color: inherit;
    font-size: 12px;
    position: relative;
    opacity: 0.8;
}

.fiber-metric-content {
    display: flex;
    flex-direction: column;
    min-width: 45px;
}

.fiber-metric-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 1px;
}

.fiber-metric-value {
    font-size: 13px;
    font-weight: 700;
    color: white;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    line-height: 1;
}

.fiber-metric-item:hover .fiber-metric-value {
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    transform: scale(1.03);
}

/* Animation for metric updates */
@keyframes fiber-metric-flash {
    0% { color: white; text-shadow: 0 0 5px rgba(0, 195, 255, 0.5); }
    50% { color: #40dfff; transform: scale(1.1); text-shadow: 0 0 15px rgba(0, 195, 255, 1); }
    100% { color: white; text-shadow: 0 0 5px rgba(0, 195, 255, 0.5); }
}

.fiber-metric-value.flash-update, .metric-value.flash-update {
    animation: fiber-metric-flash 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Style for the GRAND TOTAL and +2 TOTAL metrics */
#metric-grand-total, #metric-plus2-total {
    font-weight: bold;
    font-size: 1.2em;
}

/* Parent container for the GRAND TOTAL metric to make it more prominent */
#metric-grand-total-container .fiber-metric-label,
#metric-plus2-total-container .fiber-metric-label {
    font-weight: bold;
}

/* Edit House Count Popup */
.edit-hc-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
}

.edit-hc-popup-content {
    background: var(--fiber-glass-effect);
    border-radius: 12px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 195, 255, 0.2);
    border: 1px solid rgba(0, 195, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 350px;
    max-width: 90%;
    animation: popup-fade-in 0.3s ease;
}

.edit-hc-popup-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 195, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-hc-popup-header h5 {
    margin: 0;
    color: var(--fiber-accent-blue);
    font-weight: 600;
}

.edit-hc-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}

.edit-hc-close-btn:hover {
    color: #fff;
}

.edit-hc-popup-body {
    padding: 20px;
}

.edit-hc-popup .form-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.edit-hc-popup .form-control {
    background: rgba(10, 25, 40, 0.3);
    border: 1px solid rgba(0, 195, 255, 0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
}

.edit-hc-popup .form-control:focus {
    background: rgba(10, 25, 40, 0.5);
    border-color: var(--fiber-accent-blue);
    box-shadow: 0 0 0 0.25rem rgba(0, 195, 255, 0.25);
    color: white;
}

.edit-hc-popup .fiber-button {
    margin-left: 10px;
}

.edit-hc-popup .fiber-button.outline {
    background: transparent;
    border: 1px solid var(--fiber-accent-blue);
    color: var(--fiber-accent-blue);
}

.edit-hc-popup .fiber-button.outline:hover {
    background: rgba(0, 195, 255, 0.1);
}

@keyframes popup-fade-in {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Map info panel */
.info-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background-color: var(--fiber-glass-effect);
    border-radius: 12px;
    padding: 18px;
    width: 340px;
    max-width: calc(100vw - 20px); /* Ensure it fits on mobile with 10px margins */
    max-height: calc(100vh - 100px); /* Ensure it doesn't overflow the viewport */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.15);
    border: 1px solid rgba(0, 195, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    transition: all 0.3s ease;
    overflow: hidden; /* Hide overflow for main panel */
    display: flex;
    flex-direction: column;
}

.info-panel-title {
    border-bottom: 1px solid rgba(0, 195, 255, 0.2);
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: var(--fiber-accent-blue);
    font-weight: 600;
    letter-spacing: 0.5px;
    flex-shrink: 0; /* Prevent title from shrinking */
}

.info-panel-content {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    overflow-y: auto; /* Add scrolling for content */
    flex: 1; /* Allow content to expand */
    padding-right: 5px; /* Space for scrollbar */
}

/* Mobile optimizations for info panel */
@media (max-width: 576px) {
    .info-panel {
        top: auto;
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
        max-height: 75vh; /* Increased height for better content visibility */
        padding: 15px; /* Slightly reduced padding for more content space */
    }
    
    /* Make close button bigger and more tappable on mobile */
    .info-close-btn {
        padding: 8px;
        font-size: 1.2rem;
        top: 10px;
        right: 10px;
    }
    
    /* Ensure content is readable */
    .info-panel-content {
        font-size: 1rem; /* Slightly larger font on mobile */
        padding-right: 3px; /* Reduced scrollbar space */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    /* Ensure title fits properly */
    .info-panel-title {
        font-size: 1.2rem;
        margin-bottom: 12px;
        padding-right: 30px; /* Space for close button */
    }
}

.info-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    cursor: pointer;
    opacity: 0.7;
    color: var(--fiber-accent-blue);
    transition: all 0.2s ease;
}

.info-close-btn:hover {
    opacity: 1;
    transform: rotate(90deg);
    color: white;
    text-shadow: 0 0 8px var(--fiber-glow-primary);
}

/* Enhanced Navbar for Fiber Tree */
.navbar.fiber-navbar {
    background: var(--fiber-nav-bg) !important;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.25), 0 0 10px var(--fiber-glow-primary);
    border-bottom: 1px solid var(--fiber-nav-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.75rem 1rem;
    position: relative;
    z-index: 1030;
}

.navbar.fiber-navbar::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--fiber-light-pulse), transparent);
    opacity: 0.6;
    animation: light-pulse 4s infinite;
}

.navbar.fiber-navbar .navbar-brand {
    color: white;
    font-weight: 600;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: 8px 15px;
    border-radius: 8px;
    margin-right: 20px;
    transition: all 0.3s ease;
}

.navbar.fiber-navbar .navbar-brand:hover {
    background: rgba(0, 195, 255, 0.1);
    transform: translateY(-1px);
}

.navbar.fiber-navbar .navbar-brand i {
    margin-right: 10px;
    color: var(--fiber-accent-blue);
    filter: drop-shadow(0 0 8px var(--fiber-glow-primary));
    transition: all 0.3s ease;
}

.navbar.fiber-navbar .navbar-brand:hover i {
    transform: scale(1.1) rotate(-5deg);
    color: white;
}

.navbar.fiber-navbar .navbar-brand::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -15px;
    width: 15px;
    height: 1px;
    background: var(--fiber-light-trail);
    animation: brand-trail 3s infinite;
    opacity: 0;
}

.navbar.fiber-navbar .navbar-brand:hover::after {
    opacity: 1;
}

.navbar.fiber-navbar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 15px;
    margin: 0 3px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.navbar.fiber-navbar .nav-link:hover {
    color: white;
    background: var(--fiber-nav-item-hover);
    transform: translateY(-1px);
}

.navbar.fiber-navbar .nav-link.active {
    color: white;
    background: linear-gradient(180deg, rgba(0, 195, 255, 0.15), rgba(0, 195, 255, 0.05));
    box-shadow: 0 0 15px rgba(0, 195, 255, 0.15);
    font-weight: 500;
    border: 1px solid rgba(0, 195, 255, 0.2);
}

.navbar.fiber-navbar .nav-link i {
    color: var(--fiber-accent-blue);
    transition: all 0.3s ease;
}

.navbar.fiber-navbar .nav-link:hover i,
.navbar.fiber-navbar .nav-link.active i {
    color: white;
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px var(--fiber-glow-primary));
}

.navbar.fiber-navbar .navbar-toggler {
    border: 1px solid rgba(0, 195, 255, 0.2);
    background: rgba(0, 195, 255, 0.05);
}

.navbar.fiber-navbar .navbar-toggler:focus {
    box-shadow: 0 0 10px var(--fiber-glow-primary);
}

.navbar.fiber-navbar .dropdown-menu {
    background: var(--fiber-dropdown-bg);
    border: 1px solid var(--fiber-nav-border);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.5rem;
    margin-top: 10px;
}

.navbar.fiber-navbar .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: var(--fiber-dropdown-bg);
    transform: rotate(45deg);
    border-top: 1px solid var(--fiber-nav-border);
    border-left: 1px solid var(--fiber-nav-border);
}

.navbar.fiber-navbar .dropdown-item {
    color: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    transition: all 0.3s ease;
}

.navbar.fiber-navbar .dropdown-item:hover {
    background: var(--fiber-nav-item-hover);
    color: white;
    transform: translateX(3px);
}

.navbar.fiber-navbar .dropdown-item.active {
    background: linear-gradient(90deg, rgba(0, 195, 255, 0.15), rgba(0, 195, 255, 0.05));
    color: white;
    font-weight: 500;
}

.navbar.fiber-navbar .dropdown-divider {
    border-color: var(--fiber-nav-border);
    margin: 0.5rem 0;
}

/* Dashboard cards */
.dashboard-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 195, 255, 0.1);
    background-color: var(--fiber-card-bg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

.dashboard-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--fiber-light-glow), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.2);
    border: 1px solid rgba(0, 195, 255, 0.2);
}

.dashboard-card:hover::after {
    opacity: 1;
}

/* Custom animations for light effects */
@keyframes light-pulse {
    0% { opacity: 0.4; }
    50% { opacity: 0.9; }
    100% { opacity: 0.4; }
}

@keyframes brand-trail {
    0% { width: 0; opacity: 0; }
    50% { width: 25px; opacity: 0.8; }
    100% { width: 0; opacity: 0; }
}

/* Fiber Hero Section - Enhanced */
.fiber-hero {
    border-radius: 18px;
    background: var(--fiber-gradient-dark);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 195, 255, 0.2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 50px rgba(0, 50, 95, 0.15);
}

.fiber-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 20%, rgba(0, 195, 255, 0.07) 0%, transparent 50%),
        radial-gradient(circle at 80% 75%, rgba(126, 52, 202, 0.07) 0%, transparent 45%),
        radial-gradient(circle at 15% 85%, rgba(46, 125, 50, 0.05) 0%, transparent 40%);
    opacity: 1;
    z-index: 0;
}

.fiber-hero::after {
    content: '';
    position: absolute;
    width: 170%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--fiber-light-teal), var(--fiber-light-pulse), var(--fiber-light-teal), transparent);
    bottom: -1px;
    left: -35%;
    opacity: 0.85;
    animation: hero-light-sweep 8s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Light beams in the hero */
.fiber-hero .light-beam {
    position: absolute;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--fiber-light-pulse), transparent);
    opacity: 0.4;
    top: -20%;
    height: 140%;
    transform: rotate(15deg);
    z-index: 1;
    animation: light-beam-fade 7s infinite ease-in-out;
}

.fiber-hero .light-beam:nth-child(1) {
    left: 20%;
    animation-delay: 0s;
}

.fiber-hero .light-beam:nth-child(2) {
    left: 45%;
    animation-delay: 2s;
}

.fiber-hero .light-beam:nth-child(3) {
    left: 70%;
    animation-delay: 4s;
}

.fiber-hero .light-beam:nth-child(4) {
    left: 85%;
    animation-delay: 6s;
}

.fiber-hero-content {
    position: relative;
    z-index: 2;
}

.fiber-hero-title {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--fiber-text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px rgba(0, 195, 255, 0.6);
    position: relative;
    display: inline-block;
}

.fiber-hero-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--fiber-accent-blue), var(--fiber-light-teal));
    box-shadow: 0 0 15px var(--fiber-glow-primary);
    border-radius: 3px;
    opacity: 0.9;
}

.fiber-hero-subtitle {
    font-size: 1.3rem;
    color: var(--fiber-text-secondary);
    margin-bottom: 2rem;
    max-width: 80%;
    line-height: 1.6;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.fiber-hero-icon {
    font-size: 5.5rem;
    position: relative;
    color: var(--fiber-accent-blue);
    opacity: 0.9;
    filter: drop-shadow(0 0 20px var(--fiber-glow-primary));
    animation: pulse-icon 5s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Circle behind the hero icon */
.fiber-hero-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(0, 195, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: circle-pulse 6s infinite ease-in-out;
}

/* Horizontal light line under the icon */
.fiber-hero-icon::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--fiber-light-pulse), transparent);
    transform: translateX(-50%);
    opacity: 0.6;
}

@keyframes circle-pulse {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.5; }
}

@keyframes light-beam-fade {
    0% { opacity: 0; transform: translateY(-100%) rotate(15deg); }
    20% { opacity: 0.4; }
    80% { opacity: 0.4; }
    100% { opacity: 0; transform: translateY(100%) rotate(15deg); }
}

.fiber-hero .btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 8px;
    padding: 0.6rem 1.25rem;
    margin-right: 0.75rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.fiber-hero .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.8s ease;
    z-index: -1;
}

.fiber-hero .btn:hover::before {
    left: 100%;
}

.fiber-hero .btn-primary {
    background: linear-gradient(135deg, var(--fiber-accent-blue), #0085cc);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.fiber-hero .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.3);
}

.fiber-hero .btn-outline-light {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.fiber-hero .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.fiber-hero .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.fiber-hero .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-3px);
}

/* Dashboard Section Title */
.fiber-section-title {
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.fiber-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 3px;
    background: var(--fiber-accent-blue);
    box-shadow: 0 0 8px var(--fiber-glow-primary);
    border-radius: 3px;
}

/* Enhanced dashboard metrics cards with sophisticated accents */
.fiber-metric-card {
    background: linear-gradient(135deg, rgba(22, 33, 45, 0.85), rgba(35, 45, 60, 0.95));
    border-radius: 14px;
    padding: 1.75rem;
    text-align: center;
    border: 1px solid rgba(0, 195, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

/* Card stripe at the top */
.fiber-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--fiber-copper);
    opacity: 0.7;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.fiber-metric-card:nth-child(2)::before {
    background: var(--fiber-sage);
}

.fiber-metric-card:nth-child(3)::before {
    background: var(--fiber-moss-green);
}

.fiber-metric-card:nth-child(4)::before {
    background: var(--fiber-slate);
}

/* Light pulse overlay */
.fiber-metric-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--fiber-light-soft), transparent);
    transform: skewX(-20deg);
    transition: all 0.7s ease;
}

.fiber-metric-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.2);
    border: 1px solid rgba(0, 195, 255, 0.25);
}

.fiber-metric-card:hover::before {
    height: 5px;
    opacity: 1;
}

.fiber-metric-card:hover::after {
    left: 150%;
}

/* Icon container circle */
.fiber-metric-icon-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin-bottom: 1.25rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 25, 40, 0.8) 0%, rgba(12, 20, 35, 0.6) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.fiber-metric-icon-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 195, 255, 0.2);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.fiber-metric-card:hover .fiber-metric-icon-container::before {
    border-width: 2px;
    box-shadow: 0 0 15px rgba(0, 195, 255, 0.3);
    opacity: 0.8;
}

.fiber-metric-icon {
    font-size: 2.25rem;
    color: var(--fiber-accent-blue);
    filter: drop-shadow(0 0 10px rgba(0, 195, 255, 0.5));
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
}

.fiber-metric-card:hover .fiber-metric-icon {
    transform: scale(1.15);
    color: var(--fiber-light-bright);
    filter: drop-shadow(0 0 12px rgba(104, 220, 255, 0.8));
}

.fiber-metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--fiber-text-primary) 30%, var(--fiber-light-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.4rem;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

.fiber-metric-card:hover .fiber-metric-value {
    transform: scale(1.05);
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
}

.fiber-metric-label {
    font-size: 0.95rem;
    color: var(--fiber-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 500;
    margin-bottom: 0;
    position: relative;
}

.fiber-metric-label::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 30px;
    height: 2px;
    background: var(--fiber-accent-blue);
    transform: translateX(-50%);
    opacity: 0;
    transition: all 0.3s ease;
}

.fiber-metric-card:hover .fiber-metric-label::after {
    opacity: 0.7;
}

/* Enhanced action cards with premium aesthetics */
.fiber-action-card {
    background: var(--fiber-gradient-dark);
    border-radius: 16px;
    border: 1px solid rgba(0, 195, 255, 0.15);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    height: 100%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Gradient line at bottom */
.fiber-action-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--fiber-accent-blue), var(--fiber-light-teal), var(--fiber-accent-purple));
    opacity: 0.6;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Subtle inner shadow at top */
.fiber-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom, rgba(0, 195, 255, 0.03), transparent);
    opacity: 0.7;
    z-index: 0;
    transition: all 0.4s ease;
}

.fiber-action-card:hover {
    transform: translateY(-7px);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.3), 
        0 0 20px rgba(0, 195, 255, 0.2), 
        0 0 0 1px rgba(0, 195, 255, 0.2) inset;
}

.fiber-action-card:hover::after {
    height: 5px;
    opacity: 0.85;
}

.fiber-action-card:hover::before {
    height: 120px;
    opacity: 0.9;
}

.fiber-card-header {
    border-bottom: 1px solid rgba(0, 195, 255, 0.15);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    background: rgba(10, 25, 45, 0.5);
}

.fiber-card-title {
    margin: 0;
    font-weight: 600;
    color: var(--fiber-accent-blue);
    font-size: 1.15rem;
    letter-spacing: 0.4px;
    position: relative;
    display: inline-block;
    text-shadow: 0 0 10px rgba(0, 195, 255, 0.3);
}

/* Underline effect for card title */
.fiber-card-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--fiber-accent-blue);
    transition: width 0.3s ease;
    opacity: 0.8;
}

.fiber-action-card:hover .fiber-card-title::after {
    width: 100%;
}

.fiber-card-title i {
    margin-right: 0.5rem;
    color: var(--fiber-accent-blue);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.fiber-action-card:hover .fiber-card-title i {
    transform: translateX(-3px) scale(1.1);
}

.fiber-card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.fiber-action-btn {
    margin-bottom: 0.9rem;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    padding: 0.9rem 1.25rem;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 25, 45, 0.4);
    color: var(--fiber-text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    text-align: left;
}

/* Shimmer effect */
.fiber-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 120%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.05), 
        rgba(255, 255, 255, 0.1), 
        rgba(255, 255, 255, 0.05), 
        transparent
    );
    transform: skewX(-25deg);
    transition: all 0.7s ease;
    z-index: 0;
}

.fiber-action-btn:hover::before {
    left: 150%;
}

/* Icon styling */
.fiber-action-btn i {
    margin-right: 0.75rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
    color: var(--fiber-accent-blue);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.fiber-action-btn:hover i {
    transform: scale(1.3) translateX(-2px);
    color: white;
    filter: drop-shadow(0 0 8px rgba(0, 195, 255, 0.5));
}

/* Action button variants */
.fiber-action-btn.btn-outline-primary {
    color: var(--fiber-accent-blue);
    border-color: rgba(0, 195, 255, 0.25);
}

.fiber-action-btn.btn-outline-primary:hover {
    color: white;
    background: rgba(0, 195, 255, 0.15);
    border-color: var(--fiber-accent-blue);
    transform: translateY(-4px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.25), 0 0 15px rgba(0, 195, 255, 0.25);
}

.fiber-action-btn.btn-outline-success {
    border-color: rgba(76, 175, 80, 0.25);
}

.fiber-action-btn.btn-outline-success i {
    color: var(--fiber-status-success);
}

.fiber-action-btn.btn-outline-success:hover {
    background: rgba(76, 175, 80, 0.15);
    color: white;
    border-color: var(--fiber-status-success);
    transform: translateY(-4px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.25), 0 0 15px rgba(76, 175, 80, 0.25);
}

.fiber-action-btn.btn-outline-success:hover i {
    color: white;
    filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.5));
}

.fiber-action-btn.btn-outline-info {
    border-color: rgba(33, 150, 243, 0.25);
}

.fiber-action-btn.btn-outline-info i {
    color: var(--fiber-status-info);
}

.fiber-action-btn.btn-outline-info:hover {
    background: rgba(33, 150, 243, 0.15);
    color: white;
    border-color: var(--fiber-status-info);
    transform: translateY(-4px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.25), 0 0 15px rgba(33, 150, 243, 0.25);
}

.fiber-action-btn.btn-outline-info:hover i {
    color: white;
    filter: drop-shadow(0 0 8px rgba(33, 150, 243, 0.5));
}

.fiber-action-btn.btn-outline-danger {
    border-color: rgba(244, 67, 54, 0.25);
}

.fiber-action-btn.btn-outline-danger i {
    color: var(--fiber-status-danger);
}

.fiber-action-btn.btn-outline-danger:hover {
    background: rgba(244, 67, 54, 0.15);
    color: white;
    border-color: var(--fiber-status-danger);
    transform: translateY(-4px);
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.25), 0 0 15px rgba(244, 67, 54, 0.25);
}

.fiber-action-btn.btn-outline-danger:hover i {
    color: white;
    filter: drop-shadow(0 0 8px rgba(244, 67, 54, 0.5));
}

/* Enhanced about section with professional aesthetics */
.fiber-about-card {
    background: var(--fiber-gradient-dark);
    border-radius: 16px;
    border: 1px solid rgba(0, 195, 255, 0.15);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    height: 100%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Decorative background pattern */
.fiber-about-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 800 800'%3E%3Cg fill='none' stroke='%23022235' stroke-width='1'%3E%3Cpath d='M769 229L1037 260.9M927 880L731 737 520 660 309 538 40 599 295 764 126.5 879.5 40 599-197 493 102 382-31 229 126.5 79.5-69-63'/%3E%3Cpath d='M-31 229L237 261 390 382 603 493 308.5 537.5 101.5 381.5M370 905L295 764'/%3E%3Cpath d='M520 660L578 842 731 737 840 599 603 493 520 660 295 764 309 538 390 382 539 269 769 229 577.5 41.5 370 105 295 -36 126.5 79.5 237 261 102 382 40 599 -69 737 127 880'/%3E%3Cpath d='M520-140L578.5 42.5 731-63M603 493L539 269 237 261 370 105M902 382L539 269M390 382L102 382'/%3E%3Cpath d='M-222 42L126.5 79.5 370 105 539 269 577.5 41.5 927 80 769 229 902 382 603 493 731 737M295-36L577.5 41.5M578 842L295 764M40-201L127 80M102 382L-261 269'/%3E%3C/g%3E%3Cg fill='%23007aa5'%3E%3Ccircle cx='769' cy='229' r='5'/%3E%3Ccircle cx='539' cy='269' r='5'/%3E%3Ccircle cx='603' cy='493' r='5'/%3E%3Ccircle cx='731' cy='737' r='5'/%3E%3Ccircle cx='520' cy='660' r='5'/%3E%3Ccircle cx='309' cy='538' r='5'/%3E%3Ccircle cx='295' cy='764' r='5'/%3E%3Ccircle cx='40' cy='599' r='5'/%3E%3Ccircle cx='102' cy='382' r='5'/%3E%3Ccircle cx='127' cy='80' r='5'/%3E%3Ccircle cx='370' cy='105' r='5'/%3E%3Ccircle cx='578' cy='42' r='5'/%3E%3Ccircle cx='237' cy='261' r='5'/%3E%3Ccircle cx='390' cy='382' r='5'/%3E%3C/g%3E%3C/svg%3E") no-repeat center center;
    opacity: 0.05;
    z-index: 0;
    transition: all 0.4s ease;
}

/* Subtle gradient highlight at bottom */
.fiber-about-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--fiber-copper), var(--fiber-stone), var(--fiber-sage));
    opacity: 0.6;
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.fiber-about-card:hover {
    transform: translateY(-7px);
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.3), 
        0 0 20px rgba(0, 195, 255, 0.2), 
        0 0 0 1px rgba(0, 195, 255, 0.2) inset;
}

.fiber-about-card:hover::before {
    opacity: 0.08;
    transform: scale(1.05);
}

.fiber-about-card:hover::after {
    height: 5px;
    opacity: 0.85;
}

/* Content styling */
.fiber-about-card .fiber-card-body {
    position: relative;
    z-index: 1;
}

.fiber-about-card p {
    color: var(--fiber-text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.fiber-about-card p:last-child {
    margin-bottom: 0;
}

.fiber-about-card ul {
    margin: 1.25rem 0;
    padding-left: 0.5rem;
    list-style: none;
}

.fiber-about-card li {
    margin-bottom: 0.75rem;
    position: relative;
    color: var(--fiber-text-secondary);
    padding-left: 1.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: all 0.3s ease;
}

/* Custom bullet points with a glow effect */
.fiber-about-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fiber-accent-blue);
    box-shadow: 0 0 8px var(--fiber-glow-primary);
    transition: all 0.3s ease;
}

.fiber-about-card li:hover {
    transform: translateX(3px);
    color: var(--fiber-text-primary);
}

.fiber-about-card li:hover::before {
    transform: scale(1.3);
    box-shadow: 0 0 12px var(--fiber-glow-primary);
}

/* Alert styling */
.fiber-alert {
    background: rgba(0, 30, 60, 0.5);
    border: 1px solid rgba(0, 195, 255, 0.2);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.fiber-alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--fiber-accent-blue);
}

.fiber-alert.fiber-alert-secondary::before {
    background: var(--fiber-clay);
}

.fiber-alert i {
    color: var(--fiber-accent-blue);
    margin-right: 0.5rem;
}

.fiber-alert a {
    color: var(--fiber-accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.fiber-alert a:hover {
    color: white;
    text-decoration: underline;
}

/* Modal styling */
.fiber-modal .modal-content {
    background: linear-gradient(135deg, rgba(18, 30, 50, 0.95), rgba(16, 25, 40, 0.98));
    border: 1px solid rgba(0, 195, 255, 0.2);
    border-radius: 16px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.6), 
        0 0 30px rgba(0, 195, 255, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
}

/* Subtle glow effect on top edge */
.fiber-modal .modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--fiber-light-pulse), transparent);
    opacity: 0.7;
}

.fiber-modal .modal-header {
    border-bottom: 1px solid rgba(0, 195, 255, 0.15);
    padding: 1.25rem 1.75rem;
    position: relative;
    background: rgba(10, 20, 35, 0.5);
}

/* Decorative element in header */
.fiber-modal .modal-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--fiber-accent-blue), transparent);
    opacity: 0.4;
}

.fiber-modal .modal-title {
    color: var(--fiber-text-primary);
    font-weight: 600;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    text-shadow: 0 0 10px rgba(0, 195, 255, 0.3);
}

.fiber-modal .modal-title i {
    margin-right: 10px;
    color: var(--fiber-accent-blue);
    filter: drop-shadow(0 0 8px rgba(0, 195, 255, 0.5));
}

.fiber-modal .modal-body {
    padding: 1.75rem;
    color: var(--fiber-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.fiber-modal .modal-body p {
    margin-bottom: 1rem;
}

.fiber-modal .modal-body p.text-danger {
    color: var(--fiber-status-danger) !important;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.fiber-modal .modal-body p.text-danger i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    color: var(--fiber-status-danger);
    filter: drop-shadow(0 0 5px rgba(244, 67, 54, 0.4));
}

.fiber-modal .modal-footer {
    border-top: 1px solid rgba(0, 195, 255, 0.15);
    padding: 1.25rem 1.75rem;
    background: rgba(10, 20, 30, 0.4);
}

.fiber-modal .btn-close {
    color: var(--fiber-text-secondary);
    text-shadow: none;
    opacity: 0.8;
    transition: all 0.3s ease;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3E%3Cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3E%3C/svg%3E") center/0.8em auto no-repeat;
}

.fiber-modal .btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.fiber-modal .btn {
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fiber-modal .btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--fiber-text-secondary);
}

.fiber-modal .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--fiber-text-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.fiber-modal .btn-danger {
    background: linear-gradient(135deg, #e53935, #c62828);
    border: 1px solid rgba(255, 50, 50, 0.2);
    color: white;
    position: relative;
    overflow: hidden;
}

.fiber-modal .btn-danger::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.fiber-modal .btn-danger:hover {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    box-shadow: 
        0 7px 20px rgba(0, 0, 0, 0.3), 
        0 0 15px rgba(255, 0, 0, 0.3);
    transform: translateY(-3px);
}

.fiber-modal .btn-danger:hover::before {
    left: 100%;
}

/* Modal fade animation enhancement */
.modal.fade .modal-dialog {
    transform: scale(0.95) translateY(-30px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0);
}

/* Custom animations for homepage */
@keyframes hero-light-sweep {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

@keyframes pulse-icon {
    0% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(0, 195, 255, 0.5)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 25px rgba(0, 195, 255, 0.8)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(0, 195, 255, 0.5)); }
}

/* Fiber Footer Design */
.fiber-footer {
    background: var(--fiber-nav-bg);
    border-top: 1px solid var(--fiber-nav-border);
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

.fiber-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--fiber-light-pulse), transparent);
    opacity: 0.6;
    animation: light-pulse 4s infinite;
}

.fiber-footer-brand {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.fiber-footer-brand i {
    font-size: 1.5rem;
    margin-right: 0.75rem;
    color: var(--fiber-accent-blue);
    filter: drop-shadow(0 0 8px var(--fiber-glow-primary));
}

.fiber-footer-brand span {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.fiber-footer-tagline {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0;
    font-size: 0.95rem;
}

.fiber-footer-links {
    margin-bottom: 1rem;
}

.fiber-footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-left: 1.25rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.fiber-footer-links a i {
    margin-right: 0.4rem;
    color: var(--fiber-accent-blue);
    transition: all 0.3s ease;
}

.fiber-footer-links a:hover {
    color: white;
    transform: translateY(-2px);
}

.fiber-footer-links a:hover i {
    transform: scale(1.2);
    color: white;
}

.fiber-footer-copyright {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Media queries for responsive footer */
@media (max-width: 767px) {
    .fiber-footer {
        text-align: center;
    }
    
    .fiber-footer-brand {
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .fiber-footer-links {
        margin: 1.5rem 0;
    }
    
    .fiber-footer-links a {
        margin: 0 0.75rem;
    }
    
    .col-md-6.text-md-end {
        text-align: center !important;
    }
}

/* Import form */
.import-container {
    max-width: 800px;
    margin: 30px auto;
}

.upload-section {
    background-color: var(--fiber-card-bg);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(0, 195, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.file-input-container {
    position: relative;
    margin-bottom: 15px;
}

.file-input-feedback {
    font-size: 0.8rem;
    margin-top: 5px;
    color: var(--bs-gray-600);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.3s;
}

.loading-overlay.active {
    visibility: visible;
    opacity: 1;
}

.spinner-container {
    text-align: center;
}

.loading-text {
    margin-top: 15px;
    color: white;
}

/* Custom marker colors - Fiber Optics Theme */
.marker-pole {
    color: var(--fiber-accent-blue);
    text-shadow: 0 0 5px var(--fiber-glow-primary);
    transition: all 0.3s ease;
}

.marker-pedestal {
    color: #00e676;
    text-shadow: 0 0 5px rgba(0, 230, 118, 0.7);
    transition: all 0.3s ease;
}

.marker-other {
    color: #ffea00;
    text-shadow: 0 0 5px rgba(255, 234, 0, 0.7);
    transition: all 0.3s ease;
}

/* Hover effects for markers */
.marker-pole:hover, .marker-pedestal:hover, .marker-other:hover {
    transform: scale(1.1);
}

/* House count circle for poles - fiber optic style */
.house-count-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--fiber-accent-blue), #0066cc);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    box-shadow: 0 0 8px rgba(0, 179, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 1500 !important; /* Ensure house counts always appear above other map elements */
    position: relative; /* Required for z-index to work */
}

.house-count-circle:hover {
    box-shadow: 0 0 12px rgba(0, 179, 255, 0.8);
    transform: scale(1.1);
}

/* Special styling for house counts when in place splice mode */
.house-count-circle.splice-mode-visible {
    /* Larger, more visible shadow effect during place splice mode */
    box-shadow: 0 0 12px rgba(0, 179, 255, 1), 0 0 20px rgba(255, 255, 255, 0.6);
    /* Slightly larger size */
    transform: scale(1.2);
    /* Ensure they're on top */
    z-index: 3000 !important;
}

/* Make house counts more visible when in edit saved group mode */
body:has([data-editing-group="true"]) .house-count-circle {
    box-shadow: 0 0 12px gold !important;
    transform: scale(1.3) !important;
    z-index: 5000 !important;
}
    /* Add subtle pulse animation */
    animation: splice-mode-pulse 2s infinite alternate ease-in-out;
}

@keyframes splice-mode-pulse {
    0% {
        box-shadow: 0 0 12px rgba(0, 179, 255, 0.9), 0 0 15px rgba(255, 255, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 15px rgba(0, 179, 255, 1), 0 0 25px rgba(255, 255, 255, 0.7);
    }
}

/* Port size color coding - fiber optic style */
.port-color-darkblue {
    background: linear-gradient(145deg, #0033cc, #001a66) !important;
    box-shadow: 0 0 8px rgba(0, 51, 204, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.port-color-yellow {
    background: linear-gradient(145deg, #ffd700, #cc9900) !important;
    color: #000 !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.port-color-orange {
    background: linear-gradient(145deg, #ff8c00, #cc5500) !important;
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.port-color-purple {
    background: linear-gradient(145deg, #9900cc, #660066) !important;
    box-shadow: 0 0 8px rgba(153, 0, 204, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.port-color-green {
    background: linear-gradient(145deg, #00cc44, #007722) !important;
    box-shadow: 0 0 8px rgba(0, 204, 68, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.port-color-red {
    background: linear-gradient(145deg, #ff3333, #cc0000) !important;
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Oversized count (21+) as square - Fiber Optic Style */
.oversized-count-square {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: linear-gradient(145deg, #ff3333, #cc0000);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.oversized-count-square:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.7);
}

/* Small green circle for poles with zero count - Fiber Optic Style */
.zero-count-circle {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(0, 230, 118, 0.05);
    border: 1.5px solid rgba(0, 230, 118, 0.6);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
    transition: all 0.3s ease;
}

.zero-count-circle:hover {
    transform: scale(1.2);
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.6);
    background-color: rgba(0, 230, 118, 0.1);
}

/* Upsize button styling - Fiber Optic Style */
.upsize-btn {
    background: linear-gradient(145deg, var(--fiber-accent-purple), #5f2699);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    margin-left: 10px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(126, 52, 202, 0.4);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.upsize-btn:hover {
    background: linear-gradient(145deg, #8a39d7, var(--fiber-accent-purple));
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(126, 52, 202, 0.6);
}

.upsize-btn:disabled {
    background: linear-gradient(145deg, #666, #444);
    box-shadow: none;
    cursor: not-allowed;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Address number display - Fiber Optic Style */
.address-number {
    color: rgba(255, 120, 120, 0.9);
    font-weight: bold;
    font-size: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px 4px;
    border-radius: 4px;
    text-shadow: 0 0 3px rgba(255, 0, 0, 0.3), 0 0 6px rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.address-number:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.4);
}

/* Dark mode tooltips for map - Fiber Optic Style */
.leaflet-tooltip {
    background: var(--fiber-glass-effect) !important;
    color: white !important;
    border: 1px solid rgba(0, 195, 255, 0.2) !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 195, 255, 0.1) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
}

.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
    border-color: transparent !important;
}

.leaflet-tooltip.active {
    transform: scale(1.05) !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 195, 255, 0.2) !important;
}

/* Group label styles - Fiber Optic Style */
.group-label {
    padding: 6px 10px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 195, 255, 0.15);
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
    background: var(--fiber-glass-effect);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* Terminator label styles for map display */
.terminator-label {
    color: white;
    white-space: nowrap;
    font-size: 12px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 1), 0 0 2px rgba(0, 0, 0, 1);
    transform: translateX(12px);
    z-index: 1000 !important;
    position: relative;
    pointer-events: none;
}

.terminator-name {
    font-weight: bold;
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* Hide the terminator group name */
.terminator-group {
    display: none;
}

/* Hide the default marker container */
.terminator-marker {
    background: transparent !important;
    border: none !important;
    z-index: 1000 !important;
    pointer-events: none !important;
}

/* Ensure terminator markers stay below UI elements */
.leaflet-marker-pane .terminator-marker {
    z-index: 1000 !important;
}

/* S-number group label - Fiber Optic Style */
@keyframes sxx-pulse-glow {
    0% { box-shadow: 0 0 5px rgba(0, 0, 0, 0.7), 0 0 8px rgba(161, 90, 242, 0.6); }
    50% { box-shadow: 0 0 6px rgba(0, 0, 0, 0.7), 0 0 12px rgba(161, 90, 242, 0.8); }
    100% { box-shadow: 0 0 5px rgba(0, 0, 0, 0.7), 0 0 8px rgba(161, 90, 242, 0.6); }
}

/* Improved group label styling with gaussian blur background */
.group-label {
    background: rgba(161, 90, 242, 0.3) !important;
    border: 1px solid rgba(161, 90, 242, 0.8) !important;
    color: white !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9) !important;
    backdrop-filter: blur(8px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(8px) saturate(150%) !important;
    box-shadow: 0 2px 8px rgba(161, 90, 242, 0.4), 
                0 0 12px rgba(161, 90, 242, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    display: inline-block !important;
    width: fit-content !important;
    height: fit-content !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}

.group-label:hover {
    background: rgba(161, 90, 242, 0.5) !important;
    box-shadow: 0 4px 12px rgba(161, 90, 242, 0.6), 
                0 0 20px rgba(161, 90, 242, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.05) !important;
}

/* Reduce trunk tube label prominence */
.trunk-tubes-label {
    opacity: 0.85;
    font-size: 10px;
}

.trunk-tubes-title {
    font-weight: 500;
    margin-bottom: 2px;
    font-size: 11px;
}

.trunk-tubes-list {
    font-size: 9px;
    line-height: 1.2;
}

/* Modern Label Controls */
.modern-label-controls {
    background: linear-gradient(145deg, rgba(0, 0, 0, 0.9), rgba(20, 20, 30, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 195, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 195, 255, 0.2);
}

.controls-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(0, 195, 255, 0.9);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.controls-title i {
    font-size: 18px;
    color: rgba(161, 90, 242, 0.8);
}

.controls-actions {
    display: flex;
    gap: 8px;
}

.control-action-btn {
    background: rgba(0, 195, 255, 0.1);
    border: 1px solid rgba(0, 195, 255, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: rgba(0, 195, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.control-action-btn:hover {
    background: rgba(0, 195, 255, 0.2);
    border-color: rgba(0, 195, 255, 0.5);
    color: rgba(0, 195, 255, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 195, 255, 0.2);
}

.controls-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.modern-toggle-item {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.modern-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 6px;
    width: 100%;
}

.modern-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.switch-slider {
    position: relative;
    width: 32px;
    height: 16px;
    background: rgba(40, 40, 50, 0.8);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        inset 0 1px 2px rgba(0, 0, 0, 0.3),
        0 1px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.switch-slider:before {
    content: "";
    position: absolute;
    height: 12px;
    width: 12px;
    left: 1px;
    top: 1px;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    border-radius: 50%;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.3),
        0 1px 1px rgba(0, 0, 0, 0.2);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    min-width: 0;
    flex: 1;
}

.toggle-label i {
    font-size: 12px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-label span {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Active states */
.modern-switch input:checked + .switch-slider:before {
    transform: translateX(16px);
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.4),
        0 1px 2px rgba(0, 0, 0, 0.3);
}

.modern-switch input:checked ~ .toggle-label span {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

/* Individual toggle colors */
.switch-slider.groups {
    background: rgba(40, 40, 50, 0.8);
}

.modern-switch input:checked + .switch-slider.groups {
    background: linear-gradient(45deg, rgba(161, 90, 242, 0.8), rgba(161, 90, 242, 0.6));
    border-color: rgba(161, 90, 242, 0.5);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 16px rgba(161, 90, 242, 0.4);
}

.modern-switch input:checked ~ .toggle-label i.fa-sitemap {
    color: rgba(161, 90, 242, 1);
}

.switch-slider.terminators {
    background: rgba(40, 40, 50, 0.8);
}

.modern-switch input:checked + .switch-slider.terminators {
    background: linear-gradient(45deg, rgba(255, 193, 7, 0.8), rgba(255, 193, 7, 0.6));
    border-color: rgba(255, 193, 7, 0.5);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 16px rgba(255, 193, 7, 0.4);
}

.modern-switch input:checked ~ .toggle-label i.fa-plug {
    color: rgba(255, 193, 7, 1);
}

.switch-slider.trunks {
    background: rgba(40, 40, 50, 0.8);
}

.modern-switch input:checked + .switch-slider.trunks {
    background: linear-gradient(45deg, rgba(0, 195, 255, 0.8), rgba(0, 195, 255, 0.6));
    border-color: rgba(0, 195, 255, 0.5);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 16px rgba(0, 195, 255, 0.4);
}

.modern-switch input:checked ~ .toggle-label i.fa-subway {
    color: rgba(0, 195, 255, 1);
}

.switch-slider.connections {
    background: rgba(40, 40, 50, 0.8);
}

.modern-switch input:checked + .switch-slider.connections {
    background: linear-gradient(45deg, rgba(40, 167, 69, 0.8), rgba(40, 167, 69, 0.6));
    border-color: rgba(40, 167, 69, 0.5);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 16px rgba(40, 167, 69, 0.4);
}

.modern-switch input:checked ~ .toggle-label i.fa-project-diagram {
    color: rgba(40, 167, 69, 1);
}

.switch-slider.colors {
    background: rgba(40, 40, 50, 0.8);
}

.modern-switch input:checked + .switch-slider.colors {
    background: linear-gradient(45deg, rgba(220, 53, 69, 0.8), rgba(220, 53, 69, 0.6));
    border-color: rgba(220, 53, 69, 0.5);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 16px rgba(220, 53, 69, 0.4);
}

.modern-switch input:checked ~ .toggle-label i.fa-palette {
    color: rgba(220, 53, 69, 1);
}

.switch-slider.grid {
    background: rgba(40, 40, 50, 0.8);
}

.modern-switch input:checked + .switch-slider.grid {
    background: linear-gradient(45deg, rgba(108, 117, 125, 0.8), rgba(108, 117, 125, 0.6));
    border-color: rgba(108, 117, 125, 0.5);
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 16px rgba(108, 117, 125, 0.4);
}

.modern-switch input:checked ~ .toggle-label i.fa-th {
    color: rgba(108, 117, 125, 1);
}

/* Hover effects */
.modern-switch:hover .switch-slider {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.modern-switch:hover .toggle-label {
    transform: translateY(-2px);
}

.modern-switch:hover .toggle-label span {
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive design */
@media (max-width: 1200px) {
    .controls-grid {
        gap: 6px;
    }
    
    .toggle-label span {
        font-size: 9px;
    }
}

@media (max-width: 768px) {
    .controls-grid {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .modern-toggle-item {
        flex: 0 1 calc(50% - 2px);
        margin-bottom: 4px;
    }
    
    .controls-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .controls-actions {
        align-self: stretch;
        justify-content: center;
    }
    
    .toggle-label span {
        font-size: 8px;
    }
}

.tube-slider {
    background: rgba(0, 195, 255, 0.3) !important;
}

.label-switch input:checked + .tube-slider {
    background: rgba(0, 195, 255, 0.8) !important;
}

.connection-slider {
    background: rgba(40, 167, 69, 0.3) !important;
}

.label-switch input:checked + .connection-slider {
    background: rgba(40, 167, 69, 0.8) !important;
}

.color-slider {
    background: linear-gradient(90deg, rgba(255, 0, 0, 0.3), rgba(0, 255, 0, 0.3), rgba(0, 0, 255, 0.3)) !important;
}

.label-switch input:checked + .color-slider {
    background: linear-gradient(90deg, rgba(255, 0, 0, 0.8), rgba(0, 255, 0, 0.8), rgba(0, 0, 255, 0.8)) !important;
}

.grid-slider {
    background: rgba(108, 117, 125, 0.3) !important;
}

.label-switch input:checked + .grid-slider {
    background: rgba(108, 117, 125, 0.8) !important;
}

.label-text {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.label-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    padding: 4px 8px;
    transition: all 0.3s ease;
}

.label-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.s-number-label {
    padding: 6px 8px;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
    text-shadow: 0 0 3px rgba(0, 0, 0, 1);
    background: linear-gradient(145deg, #8e44ad, #7d3c98);
    border: 1px solid rgba(161, 90, 242, 0.8);
    letter-spacing: 0.7px;
    min-width: 60px;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    /* Make it slightly transparent to see through if it overlaps with counts */
    opacity: 0.9;
    animation: sxx-pulse-glow 3s infinite ease-in-out;
}

/* S-number badge in sidebar - Fiber Optic Style */
.s-number-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 0.7px;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
    background: linear-gradient(145deg, #8e44ad, #7d3c98);
    border: 1px solid rgba(161, 90, 242, 0.6);
    box-shadow: 0 0 8px rgba(161, 90, 242, 0.5);
    margin-right: 5px;
    transition: all 0.3s ease;
}

.group-label:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 195, 255, 0.25);
}

/* House count badge inside group label - Fiber Optic Style */
.house-count-badge {
    margin-top: 5px;
    padding: 3px 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
    border: 1px solid rgba(0, 195, 255, 0.2);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Make group tooltips permanent and styled - Fiber Optic Style */
.group-tooltip {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    opacity: 1 !important;
    font-size: 14px;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Color dot for group listing - Fiber Optic Style */
.group-color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.group-color-dot::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05));
    pointer-events: none;
}

/* Saved groups sidebar */
.saved-groups-sidebar {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1010;
    max-width: 350px;
    transition: all 0.3s ease-in-out;
    display: flex;
}

/* Collapsed state */
.saved-groups-sidebar.collapsed {
    right: -300px; /* Leave some space for the toggle to remain visible */
}

/* Sidebar toggle button */
.sidebar-toggle {
    background: linear-gradient(145deg, rgba(8, 20, 35, 0.85), rgba(22, 38, 55, 0.95));
    color: #00c6ff;
    width: 50px;
    height: 140px;
    border: none;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 195, 255, 0.3);
    border-left: 1px solid rgba(0, 225, 255, 0.25);
    border-top: 1px solid rgba(0, 225, 255, 0.25);
    border-bottom: 1px solid rgba(0, 225, 255, 0.25);
    position: relative;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fiber-pulse-glow 4s infinite ease-in-out;
    z-index: 1011;
}

.sidebar-toggle:hover {
    background: linear-gradient(145deg, rgba(12, 30, 55, 0.95), rgba(30, 50, 75, 0.95));
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 195, 255, 0.4);
    color: white;
    text-shadow: 0 0 10px rgba(0, 198, 255, 0.8);
    border-left: 1px solid rgba(0, 225, 255, 0.4);
    border-top: 1px solid rgba(0, 225, 255, 0.4);
    border-bottom: 1px solid rgba(0, 225, 255, 0.4);
}

.sidebar-toggle .sidebar-toggle-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(0, 195, 255, 0.2);
}

.sidebar-toggle:hover .sidebar-toggle-text {
    letter-spacing: 1.2px;
    text-shadow: 0 0 8px rgba(0, 195, 255, 0.4);
}

.sidebar-toggle i {
    font-size: 18px;
    margin-top: 5px;
    opacity: 0.8;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(0, 195, 255, 0.2);
}

.sidebar-toggle:hover i {
    opacity: 1;
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(0, 195, 255, 0.8);
}

/* Main sidebar content */
.sidebar-content {
    background: var(--fiber-glass-effect);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    width: 340px;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.35), 0 0 15px rgba(0, 195, 255, 0.1);
    border: 1px solid rgba(0, 195, 255, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Saved groups header */
.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h5 {
    margin: 0;
    font-weight: 600;
}

/* Saved groups container within sidebar */
#savedGroupsContainer {
    max-height: 65vh;
    overflow-y: auto;
    padding: 5px 0;
}

/* Editing mode styles for source marker */
.source-bowtie.editing {
    background: rgba(255, 255, 255, 0.7);
    border: 2px dashed #00e676;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.7);
    transform: scale(0.8);
}

.source-count-badge.editing-badge {
    background: #00e676;
    color: #000;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 8px rgba(0, 230, 118, 0.7);
    font-weight: bold;
    transform: translateY(-5px);
}

.source-marker-editing {
    opacity: 0.8;
    z-index: 1800 !important; /* Higher z-index to ensure it's visible */
}

/* Special styling for house count circles at the source device location during editing */
.house-count-circle.source-editing {
    transform: scale(1.5);
    box-shadow: 0 0 12px #00e676, 0 0 20px rgba(0, 230, 118, 0.6);
    border: 2px solid #00e676;
    z-index: 5000 !important;
    animation: pulse-source-edit 2s infinite ease-in-out;
}

@keyframes pulse-source-edit {
    0% { box-shadow: 0 0 12px #00e676, 0 0 20px rgba(0, 230, 118, 0.6); }
    50% { box-shadow: 0 0 15px #00e676, 0 0 25px rgba(0, 230, 118, 0.8); }
    100% { box-shadow: 0 0 12px #00e676, 0 0 20px rgba(0, 230, 118, 0.6); }
}

/* Editable group name styling */
.editable-name {
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    padding: 2px 4px;
}

.editable-name:hover {
    background-color: rgba(0, 198, 255, 0.1);
    color: #00c6ff;
}

.editable-name-input {
    font-family: inherit !important;
    border-radius: 4px !important;
    box-shadow: 0 0 8px rgba(0, 198, 255, 0.5) !important;
    transition: all 0.2s ease !important;
}

.editable-name-input:focus {
    box-shadow: 0 0 12px rgba(0, 198, 255, 0.8) !important;
    border-color: #00c6ff !important;
    outline: none !important;
}

/* Custom scrollbar for the container */
#savedGroupsContainer::-webkit-scrollbar {
    width: 6px;
}

#savedGroupsContainer::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

#savedGroupsContainer::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#savedGroupsContainer::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Save group button styles - Fiber Optic Style */
#save-group-btn {
    background: linear-gradient(145deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    font-size: 14px;
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.4);
    border-radius: 8px;
    padding: 8px 15px;
    transition: all 0.3s ease;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500;
    letter-spacing: 0.5px;
}

#save-group-btn:hover {
    background: linear-gradient(145deg, #33d67a, #2ecc71);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

#save-group-btn:active {
    transform: translateY(1px);
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.3);
}

/* Update group button styles - Fiber Optic Style */
#update-group-btn {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    border: none;
    font-size: 14px;
    box-shadow: 0 0 12px rgba(52, 152, 219, 0.4);
    border-radius: 8px;
    padding: 8px 15px;
    transition: all 0.3s ease;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: 500;
    letter-spacing: 0.5px;
}

#update-group-btn:hover {
    background: linear-gradient(145deg, #4aa3df, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

#update-group-btn:active {
    transform: translateY(1px);
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}

/* Total house count badge styles - Fiber Optic Style */
#total-house-count-badge {
    font-size: 14px;
    padding: 8px 12px;
    background: linear-gradient(145deg, #00b2d8, #0099cc);
    color: white;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 195, 255, 0.4);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.3px;
}

#total-house-count-badge:hover {
    box-shadow: 0 0 20px rgba(0, 195, 255, 0.6);
    transform: translateY(-1px);
}

/* Fiber buttons */
.fiber-btn {
    background: linear-gradient(145deg, var(--fiber-accent-blue), #0085cc);
    color: white;
    border: none;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0, 195, 255, 0.25);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.2s ease;
    font-weight: 500;
    letter-spacing: 0.3px;
    height: 32px;
}

.fiber-btn:hover {
    background: linear-gradient(145deg, #10c3ff, var(--fiber-accent-blue));
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(0, 195, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
}

.fiber-btn:active {
    transform: translateY(1px);
    box-shadow: 0 0 8px rgba(0, 195, 255, 0.2);
}

.map-toolbar .btn-group {
    background: rgba(10, 20, 30, 0.3);
    border-radius: 6px;
    padding: 3px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    margin-left: 8px;
}

/* Modern Fiber Optic Button Design */
.fiber-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(8, 20, 35, 0.85), rgba(22, 38, 55, 0.95));
    border: 1px solid rgba(0, 225, 255, 0.15);
    color: #00c6ff;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 0 5px rgba(0, 195, 255, 0.1);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    padding: 0;
    margin: 0 2px;
    cursor: pointer;
}

.fiber-button::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 5px;
    background: linear-gradient(90deg, transparent, rgba(0, 225, 255, 0.3), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.fiber-button:hover::before {
    transform: translateX(100%);
}

.fiber-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px rgba(0, 195, 255, 0.25);
    border-color: rgba(0, 225, 255, 0.35);
    color: #40dfff;
    text-shadow: 0 0 8px rgba(0, 195, 255, 0.8);
}

.fiber-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 0 5px rgba(0, 195, 255, 0.1);
}

.fiber-button i {
    position: relative;
    z-index: 2;
    transition: all 0.2s ease;
}

.fiber-button:hover i {
    transform: scale(1.1);
}

/* Cabinet node styling */
.cabinet-node {
    width: 30px;
    height: 30px;
    background: linear-gradient(145deg, #0066ff, #0044cc); 
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.8), 0 0 5px #fff;
    position: relative;
    transform-origin: center;
    animation: cabinet-pulse 2s infinite ease-in-out;
    z-index: 1000;
}

@keyframes cabinet-pulse {
    0% { box-shadow: 0 0 15px rgba(0, 102, 255, 0.8), 0 0 5px #fff; }
    50% { box-shadow: 0 0 25px rgba(0, 102, 255, 1), 0 0 10px #fff; }
    100% { box-shadow: 0 0 15px rgba(0, 102, 255, 0.8), 0 0 5px #fff; }
}

/* Cabinet tooltip styling */
.cabinet-tooltip {
    background: rgba(8, 20, 35, 0.8) !important;
    border: 1px solid rgba(0, 102, 255, 0.5) !important;
    border-radius: 6px !important;
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.3) !important;
    font-size: 12px !important;
    padding: 6px 10px !important;
    color: white !important;
}

/* Tube connection line label */
.tube-connection-label {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    border-radius: 8px;
    padding: 4px 6px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 0 6px rgba(0, 102, 255, 0.5);
    border: 1px solid rgba(0, 195, 255, 0.4);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
    text-align: center;
    max-width: 140px;
}

.tube-connection-label .connection-name {
    font-size: 13px;
    font-weight: bold;
    color: white;
    margin-bottom: 1px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
    background-color: rgba(0, 102, 255, 0.2);
    border-radius: 4px;
    padding: 1px 3px;
    display: inline-block;
}

/* Trunk tubes list label */
.trunk-tubes-label {
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    white-space: normal;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
    text-align: left;
    max-width: 220px;
    position: relative;
    z-index: 999;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Custom styling for different SXX groups */
[data-group="S01"] .trunk-tubes-title {
    color: #4CAF50 !important;
}

[data-group="S02"] .trunk-tubes-title {
    color: #2196F3 !important;
}

[data-group="S03"] .trunk-tubes-title {
    color: #FF9800 !important;
}

[data-group="S04"] .trunk-tubes-title {
    color: #E91E63 !important;
}

[data-group="S05"] .trunk-tubes-title {
    color: #9C27B0 !important;
}

[data-group="S06"] .trunk-tubes-title {
    color: #00BCD4 !important;
}

[data-group="S07"] .trunk-tubes-title {
    color: #CDDC39 !important;
}

[data-group="S08"] .trunk-tubes-title {
    color: #FF5722 !important;
}

[data-group="S09"] .trunk-tubes-title {
    color: #3F51B5 !important;
}

[data-group="S10"] .trunk-tubes-title {
    color: #009688 !important;
}

.trunk-tubes-label .trunk-tubes-title {
    font-size: 14px;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 8px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
    display: block;
    text-align: center;
    letter-spacing: 0.6px;
}

.trunk-tubes-label .trunk-tubes-list {
    font-size: 11px;
    line-height: 1.4;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.trunk-tubes-label .tube-item {
    display: block;
    margin: 2px 0;
    padding: 2px 4px;
    white-space: nowrap;
    font-size: 10px;
    min-width: 85px;
    text-align: left;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    transform: translateZ(0); /* Force hardware acceleration */
}

.trunk-tubes-label .tube-item:hover {
    transform: scale(1.15);
    z-index: 1000;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

/* White outline for tubes 1-24 */
.trunk-tubes-label .tube-item-1-24 {
    outline: 2px solid white;
    outline-offset: 1px;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.6);
}

.trunk-tubes-label .tube-number {
    display: inline-block;
    font-weight: bold;
    margin-right: 5px;
    min-width: 14px;
    text-align: center;
}

.trunk-tubes-label .tube-color {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.7);
    padding: 1px 2px;
    display: inline-block;
}

.trunk-tubes-label .tube-out-group {
    display: inline-block;
    margin-left: 5px;
    font-weight: bold;
    font-size: 8px;
    padding: 1px 3px;
    border-radius: 2px;
    background-color: rgba(0, 0, 0, 0.2);
    text-shadow: none;
}

/* Connection name badge in tree view */
.connection-name-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: bold;
    color: white;
    background-color: #0066cc;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    box-shadow: 0 0 5px rgba(0, 102, 255, 0.5);
    padding: 2px 4px;
    background-color: rgba(0, 102, 255, 0.4);
    border-radius: 4px;
    display: inline-block;
}

.tube-connection-label .fiber-count {
    margin-bottom: 2px;
    font-size: 11px;
}

.tube-connection-label .tube-allocation {
    font-size: 11px;
    font-weight: bold;
    color: #4CAF50; /* Green color for tube allocation */
    text-shadow: 0 0 3px rgba(76, 175, 80, 0.5);
    background-color: rgba(76, 175, 80, 0.1);
    border-radius: 4px;
    padding: 1px 3px;
    display: inline-block;
    margin-top: 2px;
}

.tube-connection-label .cable-size {
    font-size: 12px;
    font-weight: bold;
    color: #FF9800; /* Orange color for cable size */
    text-shadow: 0 0 3px rgba(255, 152, 0, 0.5);
    background-color: rgba(0, 0, 0, 0.5); /* Darker background for better contrast with colored text */
    border-radius: 4px;
    padding: 1px 3px;
    display: inline-block;
    cursor: pointer; /* Indicate it's editable */
    max-width: 170px;
    white-space: normal; /* Allow text to wrap */
    line-height: 1.3;
}

/* Connection name editable field styling */
.connection-name-input {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border: 1px solid #0066ff;
    border-radius: 4px;
    font-size: 11px;
    padding: 2px 4px;
    width: 60px;
    height: auto;
    text-align: center;
    box-shadow: 0 0 8px rgba(0, 102, 255, 0.6);
}

/* Tooltip editable elements */
.tooltip-connection-name, 
.tooltip-editable-connection {
    cursor: pointer;
    padding: 1px 3px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.tooltip-connection-name:hover, 
.tooltip-editable-connection:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Tube connection tooltip */
.tube-connection-tooltip {
    font-size: 12px;
    line-height: 1.4;
    padding: 6px 10px;
    background-color: rgba(0, 10, 20, 0.95) !important;
    color: white !important;
    border: 1px solid rgba(0, 195, 255, 0.5) !important;
    border-radius: 6px !important;
    box-shadow: 0 0 10px rgba(0, 102, 255, 0.4) !important;
}

/* Enhanced Cabinet Control Panel */
.cabinet-controls {
    margin-top: 15px;
    padding: 0;
    background: linear-gradient(145deg, rgba(8, 20, 35, 0.95), rgba(22, 38, 55, 0.95));
    border-radius: 16px;
    border: 1px solid rgba(0, 195, 255, 0.15);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4), 
        0 0 20px rgba(0, 195, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* Animated background pattern */
.cabinet-controls::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 195, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(126, 52, 202, 0.05) 0%, transparent 50%);
    opacity: 0.8;
    z-index: 0;
    animation: cabinet-bg-pulse 8s infinite ease-in-out;
}

@keyframes cabinet-bg-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.02); }
}

/* Cabinet header section */
.cabinet-header {
    position: relative;
    z-index: 2;
    padding: 18px 20px 15px;
    border-bottom: 1px solid rgba(0, 195, 255, 0.15);
    background: linear-gradient(135deg, rgba(0, 195, 255, 0.08), rgba(126, 52, 202, 0.05));
}

.cabinet-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 195, 255, 0.4), transparent);
}

.cabinet-title {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--fiber-accent-blue);
    text-shadow: 0 0 10px rgba(0, 195, 255, 0.3);
    letter-spacing: 0.5px;
}

.cabinet-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(145deg, #0066ff, #0044cc);
    border-radius: 8px;
    margin-right: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.6);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.cabinet-icon::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 8px;
    animation: icon-shimmer 3s infinite;
}

@keyframes icon-shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.cabinet-location {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cabinet-location i {
    color: var(--fiber-accent-blue);
    font-size: 14px;
}

/* Enhanced metrics grid */
.cabinet-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.cabinet-metric-card {
    background: linear-gradient(135deg, rgba(10, 25, 45, 0.8), rgba(20, 35, 55, 0.8));
    border-radius: 10px;
    padding: 12px;
    border: 1px solid rgba(0, 195, 255, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cabinet-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--fiber-accent-blue), var(--fiber-accent-purple));
    opacity: 0.7;
}

.cabinet-metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.2);
    border-color: rgba(0, 195, 255, 0.3);
}

.metric-icon {
    font-size: 18px;
    color: var(--fiber-accent-blue);
    margin-bottom: 6px;
    display: block;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    margin-bottom: 2px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.metric-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Cabinet actions section */
.cabinet-actions {
    position: relative;
    z-index: 2;
    padding: 20px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.cabinet-action-btn {
    background: linear-gradient(135deg, rgba(8, 25, 45, 0.9), rgba(15, 35, 55, 0.9));
    border: 1px solid rgba(0, 195, 255, 0.2);
    border-radius: 10px;
    padding: 14px 16px;
    color: white;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.cabinet-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 195, 255, 0.1), transparent);
    transition: all 0.6s ease;
}

.cabinet-action-btn:hover::before {
    left: 100%;
}

.cabinet-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.25);
    border-color: rgba(0, 195, 255, 0.4);
    background: linear-gradient(135deg, rgba(0, 195, 255, 0.15), rgba(15, 35, 55, 0.9));
}

.cabinet-action-btn i {
    font-size: 16px;
    color: var(--fiber-accent-blue);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.cabinet-action-btn:hover i {
    color: white;
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(0, 195, 255, 0.5));
}

.action-text {
    flex: 1;
    text-align: left;
}

.action-title {
    font-weight: 600;
    margin-bottom: 2px;
    color: white;
}

.action-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.2;
}

/* Button variants */
.cabinet-action-btn.primary {
    border-color: rgba(0, 195, 255, 0.3);
}

.cabinet-action-btn.success {
    border-color: rgba(40, 167, 69, 0.3);
}

.cabinet-action-btn.success i {
    color: #28a745;
}

.cabinet-action-btn.warning {
    border-color: rgba(255, 193, 7, 0.3);
}

.cabinet-action-btn.warning i {
    color: #ffc107;
}

.cabinet-action-btn.danger {
    border-color: rgba(220, 53, 69, 0.3);
}

.cabinet-action-btn.danger i {
    color: #dc3545;
}

/* Quick stats bar */
.cabinet-quick-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(0, 195, 255, 0.1);
    position: relative;
    z-index: 2;
}

.quick-stat {
    text-align: center;
    flex: 1;
}

.quick-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fiber-accent-blue);
    margin-bottom: 2px;
}

.quick-stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 8px;
}

.status-indicator.online {
    background: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.status-indicator.offline {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Mobile optimizations for cabinet controls */
@media (max-width: 576px) {
    .cabinet-controls {
        padding: 12px;
        margin-top: 10px;
        margin-bottom: 10px;
    }
    
    /* Make cabinet buttons easier to tap on mobile */
    .cabinet-controls .btn {
        padding: 10px 12px; 
        margin: 4px 2px;
        min-width: 90px; /* Ensure buttons are easily tappable */
        font-size: 0.9rem;
    }
    
    /* Better button layout on mobile */
    .cabinet-controls .d-flex {
        gap: 6px !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
    }
    
    /* Allow cabinet summary to stack on very small screens */
    .cabinet-summary {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        padding: 12px;
        border-radius: 8px;
    }
    
    /* Make cabinet information more readable */
    .cabinet-summary .tube-summary {
        margin-top: 8px;
        padding: 4px 8px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 4px;
        display: inline-block;
        font-weight: 500;
    }
    
    /* Better cabinet details display */
    .cabinet-controls h5 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .cabinet-controls p {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .cabinet-summary > div {
        width: 100%;
        margin-top: 5px;
    }
}

/* Fiber button group styling */
.fiber-button-group {
    display: flex;
    border-radius: 12px;
    background: rgba(10, 20, 35, 0.5);
    padding: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 0 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 225, 255, 0.05);
}

.fiber-button-group .fiber-button {
    margin: 0 3px;
}

/* Action button variant */
.fiber-button.action-button {
    background: linear-gradient(145deg, rgba(0, 125, 190, 0.8), rgba(0, 95, 145, 0.9));
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 225, 255, 0.25);
}

.fiber-button.action-button:hover {
    background: linear-gradient(145deg, rgba(0, 155, 220, 0.8), rgba(0, 125, 175, 0.9));
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 195, 255, 0.3);
}

/* Danger button variant */
.fiber-button.danger-button {
    background: linear-gradient(145deg, rgba(220, 53, 69, 0.8), rgba(178, 34, 52, 0.9));
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 200, 200, 0.25);
    font-weight: 500;
}

.fiber-button.danger-button:hover {
    background: linear-gradient(145deg, rgba(240, 62, 80, 0.8), rgba(200, 40, 60, 0.9));
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 100, 100, 0.3);
}

/* Improved Clear Parcels button */
.fiber-button.clear-parcels-btn-improved {
    width: auto;
    padding: 0 12px;
}

.fiber-button.clear-parcels-btn-improved .clear-parcels-text {
    margin-left: 5px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Enhanced Tooltip Styling for Toolbar - Fixed Z-index */
.toolbar-btn[data-tooltip],
.toolbar-toggle[data-tooltip],
.layer-toggle[data-tooltip],
.layer-action-btn[data-tooltip],
.range-control[data-tooltip],
.house-count-badge[data-tooltip],
.fiber-button[data-tooltip],
.fiber-toggle-container[data-tooltip] {
    position: relative;
}

.toolbar-btn[data-tooltip]::after,
.toolbar-toggle[data-tooltip]::after,
.layer-toggle[data-tooltip]::after,
.layer-action-btn[data-tooltip]::after,
.range-control[data-tooltip]::after,
.house-count-badge[data-tooltip]::after,
.fiber-button[data-tooltip]::after,
.fiber-toggle-container[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: auto;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: linear-gradient(145deg, rgba(8, 20, 35, 0.98), rgba(22, 38, 55, 0.98));
    color: white;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 195, 255, 0.3);
    border: 1px solid rgba(0, 195, 255, 0.4);
    z-index: 999999 !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    max-width: 200px;
    text-align: center;
    line-height: 1.3;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.toolbar-btn[data-tooltip]:hover::after,
.toolbar-toggle[data-tooltip]:hover::after,
.layer-toggle[data-tooltip]:hover::after,
.layer-action-btn[data-tooltip]:hover::after,
.range-control[data-tooltip]:hover::after,
.house-count-badge[data-tooltip]:hover::after,
.fiber-button[data-tooltip]:hover::after,
.fiber-toggle-container[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    top: calc(100% + 12px);
}

/* Remove tooltip arrows to prevent z-index conflicts */
.toolbar-btn[data-tooltip]::before,
.toolbar-toggle[data-tooltip]::before,
.layer-toggle[data-tooltip]::before,
.layer-action-btn[data-tooltip]::before,
.range-control[data-tooltip]::before,
.house-count-badge[data-tooltip]::before,
.fiber-button[data-tooltip]::before,
.fiber-toggle-container[data-tooltip]::before {
    display: none;
}

/* Updated badge */
.fiber-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(0, 125, 190, 0.8), rgba(0, 95, 145, 0.9));
    color: white;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2), 0 0 10px rgba(0, 195, 255, 0.15);
    border: 1px solid rgba(0, 225, 255, 0.2);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Toggle switch */
.fiber-toggle-container {
    margin: 0 5px;
    position: relative;
}

.fiber-toggle {
    display: inline-flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.fiber-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.fiber-toggle-slider {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
    background: linear-gradient(145deg, rgba(8, 20, 35, 0.85), rgba(22, 38, 55, 0.95));
    border-radius: 18px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2), 0 2px 5px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 225, 255, 0.1);
    transition: all 0.3s ease;
}

.fiber-toggle-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 2px;
    background: linear-gradient(145deg, #383838, #292929);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fiber-toggle input:checked + .fiber-toggle-slider {
    background: linear-gradient(145deg, rgba(0, 125, 190, 0.8), rgba(0, 95, 145, 0.9));
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2), 0 0 10px rgba(0, 195, 255, 0.3);
    border-color: rgba(0, 225, 255, 0.3);
}

.fiber-toggle input:checked + .fiber-toggle-slider:before {
    transform: translateX(18px);
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    box-shadow: 0 0 8px rgba(0, 195, 255, 0.5);
}

.fiber-toggle-label {
    margin-left: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
    font-weight: 500;
    white-space: nowrap;
}

/* Range control styles */
.fiber-range-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    background: linear-gradient(145deg, rgba(8, 20, 35, 0.85), rgba(22, 38, 55, 0.95));
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2), 0 2px 5px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 225, 255, 0.1);
    margin: 0 5px;
}

.fiber-range-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-right: 8px;
    font-weight: 500;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.fiber-range-slider {
    -webkit-appearance: none;
    width: 100px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(145deg, rgba(60, 60, 60, 0.8), rgba(40, 40, 40, 0.9));
    outline: none;
    margin: 0 8px;
    border: 1px solid rgba(0, 225, 255, 0.1);
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
}

.fiber-range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 195, 255, 0.5), 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.fiber-range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(0, 195, 255, 0.8), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.fiber-range-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 195, 255, 0.5), 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.fiber-range-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(0, 195, 255, 0.8), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.fiber-range-value {
    font-size: 11px;
    color: rgba(0, 225, 255, 0.9);
    font-weight: 600;
    text-shadow: 0 0 4px rgba(0, 225, 255, 0.5);
    letter-spacing: 0.2px;
    min-width: 45px;
    text-align: center;
    white-space: nowrap;
}

/* Fiber toolbar container */
.fiber-toolbar {
    background: linear-gradient(to right, rgba(12, 25, 40, 0.8), rgba(16, 30, 50, 0.8), rgba(12, 25, 40, 0.8));
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.1);
    border: 1px solid rgba(0, 225, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: visible;
    animation: fiber-pulse-glow 4s infinite ease-in-out;
    min-height: 54px;
    display: flex;
    align-items: center;
    padding: 8px 5px;
    z-index: 1050;
}

.fiber-toolbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 225, 255, 0.3), transparent);
    opacity: 0.8;
}

.fiber-toolbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 225, 255, 0.1), transparent);
    opacity: 0.5;
}

@keyframes fiber-pulse-glow {
    0% { box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.1); }
    50% { box-shadow: 0 5px 30px rgba(0, 0, 0, 0.35), 0 0 25px rgba(0, 195, 255, 0.2); }
    100% { box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.1); }
}

/* Enhanced toggle switch in the toolbar */
.map-toolbar .form-check-input {
    width: 32px;
    height: 16px;
    background-color: rgba(10, 20, 30, 0.5);
    border-color: rgba(0, 195, 255, 0.3);
    cursor: pointer;
}

.map-toolbar .form-check-input:checked {
    background-color: var(--fiber-accent-blue);
    border-color: var(--fiber-accent-blue);
    box-shadow: 0 0 10px rgba(0, 195, 255, 0.5);
}

.map-toolbar .form-check-input:focus {
    box-shadow: 0 0 0 0.15rem rgba(0, 195, 255, 0.25);
    border-color: var(--fiber-accent-blue);
}

.map-toolbar .form-check-label {
    font-size: 11px;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

#refresh-metrics-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(22, 28, 40, 0.7);
    border: 1px solid rgba(0, 195, 255, 0.2);
    color: var(--fiber-accent-blue);
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    padding: 0;
}

#refresh-metrics-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(0, 195, 255, 0.2);
    background: rgba(0, 195, 255, 0.1);
    border-color: rgba(0, 195, 255, 0.4);
    color: white;
}

/* Global notification for full-screen alerts */
.global-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 80%;
    max-width: 800px;
    display: none;
}

.global-notification .alert {
    margin-bottom: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Port legend for map - Fiber Optic Style */
.port-legend {
    display: flex;
    flex-wrap: wrap;
    margin-top: 15px;
    background: rgba(22, 28, 40, 0.5);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(0, 195, 255, 0.05);
    border: 1px solid rgba(0, 195, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.port-legend-item {
    display: flex;
    align-items: center;
    margin-right: 20px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.port-legend-item:hover {
    transform: translateY(-2px);
}

.port-legend-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 8px;
    transition: all 0.3s ease;
}

.port-legend-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.3px;
    font-weight: 500;
}

.color-darkblue { 
    background: linear-gradient(145deg, #0033cc, #001a66);
    box-shadow: 0 0 8px rgba(0, 51, 204, 0.5);
}

.color-yellow { 
    background: linear-gradient(145deg, #ffd700, #cc9900);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.color-orange { 
    background: linear-gradient(145deg, #ff8c00, #cc5500);
    box-shadow: 0 0 8px rgba(255, 140, 0, 0.5);
}

.color-purple { 
    background: linear-gradient(145deg, #9900cc, #660066);
    box-shadow: 0 0 8px rgba(153, 0, 204, 0.5);
}

.color-red { 
    background: linear-gradient(145deg, #ff3333, #cc0000);
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.5);
}

/* Fiber Card - Legend Container */
.fiber-card {
    background: var(--fiber-glass-effect);
    border-radius: 15px;
    border: none;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.1);
    overflow: hidden;
    position: relative;
}

.fiber-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 195, 255, 0.05),
        transparent
    );
    animation: fiber-scan 8s infinite linear;
    pointer-events: none;
}

@keyframes fiber-scan {
    0% { left: -100%; }
    100% { left: 200%; }
}

.fiber-card-body {
    background: transparent;
    border: 1px solid rgba(0, 195, 255, 0.1);
    border-radius: 14px;
    padding: 15px;
    overflow: hidden;
}

/* Map Toolbar - Fiber Optic Style */
.map-toolbar {
    background: var(--fiber-glass-effect);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25), 0 0 10px rgba(0, 195, 255, 0.1);
    border: 1px solid rgba(0, 195, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: visible;
    animation: subtle-glow 3s infinite ease-in-out;
    min-height: 50px;
    display: flex;
    align-items: center;
    padding: 5px 0;
}

/* Custom Layer Control - Fiber Optic Style */
.leaflet-control-layers {
    background: var(--fiber-glass-effect) !important;
    border-radius: 8px !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.25), 0 0 8px rgba(0, 195, 255, 0.1) !important;
    border: 1px solid rgba(0, 195, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px !important;
    margin-top: 10px !important;
}

.leaflet-control-layers-toggle {
    background-color: rgba(22, 28, 40, 0.8) !important;
    border-radius: 6px !important;
    width: 36px !important;
    height: 36px !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(0, 195, 255, 0.2) !important;
}

.leaflet-control-layers-expanded {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 13px !important;
    min-width: 150px !important;
}

.leaflet-control-layers-selector {
    margin-right: 6px !important;
    accent-color: var(--fiber-accent-blue) !important;
}

.leaflet-control-layers-separator {
    border-top: 1px solid rgba(0, 195, 255, 0.2) !important;
    margin: 8px 0 !important;
}

.leaflet-control-layers label {
    margin-bottom: 5px !important;
    display: flex !important;
    align-items: center !important;
}

.leaflet-control-layers-overlays label:hover,
.leaflet-control-layers-base label:hover {
    color: var(--fiber-accent-blue) !important;
}

/* Line of Sight Analysis Styles */
.los-source-marker {
    color: var(--fiber-accent-blue);
    font-size: 24px;
    text-shadow: 0 0 10px rgba(0, 195, 255, 0.7);
    filter: drop-shadow(0 0 8px rgba(0, 195, 255, 0.5));
    display: flex;
    justify-content: center;
    align-items: center;
}

.los-popup {
    background: var(--fiber-glass-effect) !important;
    border-radius: 10px !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 195, 255, 0.1) !important;
    border: 1px solid rgba(0, 195, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.9) !important;
}

.los-popup .leaflet-popup-content-wrapper {
    background: transparent !important;
    box-shadow: none !important;
}

.los-popup .leaflet-popup-content {
    margin: 12px !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.los-popup .leaflet-popup-tip {
    background: var(--fiber-glass-effect) !important;
    border: 1px solid rgba(0, 195, 255, 0.2) !important;
}

.los-popup h5 {
    color: var(--fiber-accent-blue);
    font-size: 16px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.los-visible {
    color: #00cc00 !important;
}

.los-blocked {
    color: #ff6666 !important;
}

.los-range-btn {
    padding: 3px 6px !important;
    font-size: 11px !important;
    margin-right: 5px;
}

/* Map Grid Styles */
.grid-label {
    background: var(--fiber-glass-effect);
    color: var(--fiber-accent-blue);
    border-radius: 4px !important;
    padding: 2px 4px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    border: 1px solid rgba(0, 195, 255, 0.3);
    white-space: nowrap;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.major-grid-label {
    z-index: 1000 !important;
}

.major-grid-label .grid-value {
    font-weight: 600;
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
    background-color: rgba(0, 195, 255, 0.2);
}

.corner-label {
    z-index: 1001 !important;
    background: var(--fiber-glass-effect);
    border: 1px solid rgba(0, 195, 255, 0.5) !important;
    border-radius: 8px !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5) !important;
}

.top-right {
    margin-top: -85px !important;
    margin-left: -200px !important;
}

.bottom-left {
    margin-top: 0 !important;
    margin-left: 0 !important;
}

.detailed-coords {
    font-size: 11px;
    line-height: 1.3;
    padding: 5px;
    text-align: left;
}

.coord-decimal {
    font-size: 12px;
    font-weight: 600;
    color: var(--fiber-accent-blue);
    margin-bottom: 3px;
    border-bottom: 1px solid rgba(0, 195, 255, 0.3);
    padding-bottom: 3px;
}

.coord-dms {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 3px;
}

.coord-utm {
    font-size: 10px;
    color: rgba(0, 195, 255, 0.8);
    font-family: monospace;
}

.coordinate-indicator {
    background: var(--fiber-glass-effect);
    color: var(--fiber-accent-blue);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    border: 1px solid rgba(0, 195, 255, 0.3);
    white-space: nowrap;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    margin-bottom: 10px;
    min-width: 170px;
}

.map-metrics-toolbar {
    background: var(--fiber-glass-effect);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25), 0 0 10px rgba(0, 195, 255, 0.1);
    border: 1px solid rgba(0, 195, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: visible;
    animation: subtle-glow 3s infinite ease-in-out;
    padding: 8px 0;
}

@keyframes subtle-glow {
    0% { box-shadow: 0 0 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.1); }
    50% { box-shadow: 0 0 25px rgba(0, 0, 0, 0.3), 0 0 25px rgba(0, 195, 255, 0.2); }
    100% { box-shadow: 0 0 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0, 195, 255, 0.1); }
}

.map-toolbar::before, .map-metrics-toolbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 195, 255, 0.05),
        transparent
    );
    animation: fiber-scan 12s infinite linear;
    pointer-events: none;
}

/* Metric icons - Fiber Optic Style */
.metric-icon {
    color: var(--fiber-accent-blue);
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(0, 195, 255, 0.5);
    transition: all 0.3s ease;
}

.metric-content:hover .metric-icon {
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(0, 195, 255, 0.8);
}

.metric-label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.metric-value {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}

/* Map legend - Fiber Optic Style */
.map-legend {
    background: rgba(22, 28, 40, 0.5);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(0, 195, 255, 0.05);
    border: 1px solid rgba(0, 195, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Highlighted elements for nearby devices - Fiber Optic Style */
@keyframes fiber-pulse {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px var(--fiber-glow-primary); }
    50% { transform: scale(1.1); opacity: 0.9; box-shadow: 0 0 15px var(--fiber-glow-primary), 0 0 25px rgba(0, 195, 255, 0.3); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px var(--fiber-glow-primary); }
}

.highlight-pulse {
    animation: fiber-pulse 1.5s infinite ease-in-out;
    box-shadow: 0 0 12px var(--fiber-glow-primary);
    border: 2px solid rgba(0, 195, 255, 0.7);
}

/* Make marker icons pulse - Fiber Optic Style */
.fa-map-marker-alt.highlight-pulse {
    color: var(--fiber-accent-blue) !important;
    text-shadow: 0 0 15px var(--fiber-glow-primary);
}

/* Highlight style for active edit mode */
.house-count-circle.highlight, 
.fa-map-marker-alt.highlight {
    border: 2px solid #ff4500;
    box-shadow: 0 0 8px #ff4500;
}

/* Source device bowtie marker - Fiber Optic Style */
.source-bowtie {
    position: relative;
    width: 26px;
    height: 26px;
    background-color: transparent;
}

.source-bowtie::before,
.source-bowtie::after {
    content: '';
    position: absolute;
    width: 24px; 
    height: 24px;
    background: linear-gradient(145deg, var(--fiber-accent-blue), #005c99);
    top: 1px;
    left: 1px;
    transform-origin: center;
    filter: drop-shadow(0 0 3px var(--fiber-glow-primary));
}

.source-bowtie::before {
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.source-bowtie::after {
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

@keyframes fiber-glow {
    0% { box-shadow: 0 0 8px var(--fiber-glow-primary); }
    50% { box-shadow: 0 0 20px var(--fiber-glow-primary), 0 0 30px rgba(0, 195, 255, 0.3); }
    100% { box-shadow: 0 0 8px var(--fiber-glow-primary); }
}

.source-bowtie-container {
    animation: fiber-glow 2s infinite ease-in-out, fiber-pulse 2s infinite ease-in-out;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 195, 255, 0.3);
}

/* Source device count badge - Fiber Optic Style */
.source-count-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(145deg, #00c6ff, #0099cc);
    color: white;
    font-weight: bold;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 195, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    min-width: 22px;
    text-align: center;
    z-index: 1000;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

/* Tubes count display - Fiber Optic Style */
.tubes-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 0 5px rgba(0, 195, 255, 0.8), 0 0 10px rgba(0, 0, 0, 0.8);
    z-index: 999;
    letter-spacing: 0.5px;
}

/* Reposition tube count when in place splice mode to avoid overlapping house count */
.splice-mode-active .tubes-count {
    width: 20px;
    height: 20px; 
    top: -10px;
    right: -10px;
    left: auto;
    transform: none;
    background-color: rgba(0, 195, 255, 0.4);
    border-radius: 50%;
    padding: 0;
    font-size: 0; /* Hide the text content */
    content: "";
    box-shadow: 0 0 8px rgba(0, 195, 255, 0.8);
    border: 1px solid rgba(0, 195, 255, 0.5);
    animation: fiber-pulse 1.5s infinite ease-in-out;
    text-indent: -9999px; /* Hide text */
}

/* Remove text content in splice mode */
.splice-mode-active .tubes-count::before {
    content: "";
}

/* Spare count display - Fiber Optic Style */
.spare-count {
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #ffd700, #e6c200);
    color: black;
    font-weight: bold;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    min-width: 20px;
    text-align: center;
    z-index: 1000;
}

/* Context menu styles - Fiber Optic Style */
.context-menu {
    background: var(--fiber-glass-effect);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 195, 255, 0.1);
    border: 1px solid rgba(0, 195, 255, 0.1);
    padding: 10px 0;
    min-width: 200px;
    z-index: 9999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.context-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.9);
    border-left: 2px solid transparent;
}

.context-menu-item:hover {
    background-color: rgba(0, 195, 255, 0.1);
    border-left: 2px solid var(--fiber-accent-blue);
    color: white;
    text-shadow: 0 0 5px rgba(0, 195, 255, 0.5);
}

.context-menu-item i {
    width: 18px;
    text-align: center;
    color: var(--fiber-accent-blue);
    transition: all 0.25s ease;
}

.context-menu-item:hover i {
    transform: translateX(2px);
    color: white;
    text-shadow: 0 0 8px var(--fiber-glow-primary);
}

/* Group color indicator for sidebar list - Fiber Optic Style */
.group-color-indicator {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.group-color-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.05));
    pointer-events: none;
}

/* Styled group list items for the sidebar - Fiber Optic Style */
#savedGroupsList .list-group-item {
    background: rgba(22, 28, 40, 0.5) !important;
    border: 1px solid rgba(0, 195, 255, 0.1);
    margin: 10px;
    border-radius: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    position: relative;
}

#savedGroupsList .list-group-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, rgba(0, 195, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#savedGroupsList .list-group-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25), 0 0 15px rgba(0, 195, 255, 0.1);
    border: 1px solid rgba(0, 195, 255, 0.2);
}

#savedGroupsList .list-group-item:hover::before {
    opacity: 1;
}

#savedGroupsList .list-group-item .btn-group .btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 6px;
    margin-left: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: none;
}

#savedGroupsList .list-group-item .btn-group .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Footer text in sidebar - Fiber Optic Style */
.sidebar-footer {
    padding: 12px 15px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    border-top: 1px solid rgba(0, 195, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Connection Tree Styles */
.connection-tree {
    margin: 15px 0;
    max-height: 350px; /* Increased to fit more complex tree structures */
    overflow-y: auto;
    padding: 12px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.2); 
    border: 1px solid rgba(0, 195, 255, 0.1);
    position: relative;
    /* Add scroll indicator */
    background-image: linear-gradient(to bottom, 
        rgba(0, 195, 255, 0.1) 0%, 
        rgba(0, 0, 0, 0) 10%, 
        rgba(0, 0, 0, 0) 90%, 
        rgba(0, 195, 255, 0.1) 100%);
}

/* Add title for tree visualization */
.connection-tree::before {
    content: 'Connection Tree Structure';
    position: absolute;
    top: -8px;
    left: 15px;
    background: var(--fiber-dark-blue);
    padding: 1px 8px;
    font-size: 0.8rem;
    border-radius: 4px;
    color: var(--fiber-accent-blue);
    border: 1px solid rgba(0, 195, 255, 0.2);
    letter-spacing: 0.5px;
}

/* Custom scrollbar for connection tree */
.connection-tree::-webkit-scrollbar {
    width: 6px;
}

.connection-tree::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.connection-tree::-webkit-scrollbar-thumb {
    background: var(--fiber-accent-blue);
    border-radius: 10px;
    opacity: 0.7;
}

.tree-container {
    position: relative;
    padding: 10px 5px; /* Reduced horizontal padding for mobile */
}

/* Mobile optimization for the tree structure */
@media (max-width: 576px) {
    .connection-tree {
        max-height: 300px; /* Increased height for better visibility */
        padding: 10px 8px; /* Adjusted padding */
        position: relative;
        margin: 20px 0 15px 0;
    }
    
    .connection-tree::before {
        font-size: 12px; /* Smaller title text */
        padding: 4px 8px;
    }
    
    .tree-container {
        padding: 8px 3px; /* Further reduced horizontal padding for mobile */
    }
    
    .tree-node {
        margin: 8px 0; /* Slightly increased vertical spacing */
        font-size: 0.9rem; /* Slightly smaller font */
    }
    
    .tree-controls {
        display: flex;
        gap: 5px;
        margin-bottom: 10px;
        justify-content: space-between;
    }
    
    .tree-controls .btn {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    /* Make tree help text more compact */
    .tree-help-text {
        font-size: 0.75rem;
        line-height: 1.3;
        padding: 5px;
        background: rgba(0, 0, 0, 0.2);
        border-radius: 4px;
        margin-top: 10px;
    }
    
    /* Improve branch styling */
    .node-content {
        flex: 1;
        min-width: 0; /* Allow text truncation */
    }
    
    .node-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
    
    .node {
        padding: 6px 8px; /* Smaller padding */
    }
}

.tree-node {
    margin: 8px 0;
    position: relative;
}

.node {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.node:hover {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 195, 255, 0.3);
    transform: translateX(3px);
}

.node-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

.node-content {
    flex-grow: 1;
}

.node-name {
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.connection-name-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: white;
    background-color: rgba(0, 102, 255, 0.6);
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 2px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 4px rgba(0, 102, 255, 0.3);
}

.node-stats {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.cable-size-tree {
    font-weight: bold;
    color: #FF9800; /* Orange color for cable size in tree */
    text-shadow: 0 0 3px rgba(255, 152, 0, 0.5);
    display: inline-block;
    margin-top: 2px;
}

.cabinet-node .node-icon {
    background-color: var(--fiber-accent-blue);
    box-shadow: 0 0 8px var(--fiber-glow-primary);
}

.group-node .node-icon {
    background-color: #666;
}

/* Tree Visualization Styles - Enhanced for Multi-Branch Trees */
.tree-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 8px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 195, 255, 0.1);
}

.tree-controls button {
    font-size: 0.8rem;
    padding: 4px 8px;
}

.tree-branch {
    position: relative;
    padding-left: 5px;
}

.branch {
    position: relative;
    padding-left: 22px;
    margin-bottom: 5px;
    border-left: 2px solid rgba(0, 195, 255, 0.3);
}

.branch::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15px;
    width: 22px;
    height: 2px;
    background-color: rgba(0, 195, 255, 0.3);
}

.branch:last-child {
    border-left: none;
}

.branch:last-child::before {
    left: 0;
    border-left: 2px solid rgba(0, 195, 255, 0.3);
    border-bottom-left-radius: 8px;
    height: 15px;
    width: 20px;
}

.branch-children {
    overflow: visible;
    max-height: 1000px;
    transition: max-height 0.3s ease-in-out;
}

.branch-children.collapsed {
    max-height: 0;
    overflow: hidden;
}

.branch-toggle {
    margin-left: 10px;
    cursor: pointer;
    color: rgba(0, 195, 255, 0.7);
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.branch-toggle:hover {
    color: white;
    transform: scale(1.2);
}

.multi-branch-indicator {
    position: relative;
    margin: 5px 0 8px -5px;
    padding: 4px 8px;
    background: linear-gradient(90deg, rgba(0, 195, 255, 0.1), rgba(0, 102, 255, 0.15));
    border-radius: 12px;
    font-size: 0.8rem;
    color: rgba(0, 195, 255, 0.9);
    display: inline-block;
    border: 1px solid rgba(0, 195, 255, 0.2);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

.multi-branch-indicator::before {
    content: '';
    position: absolute;
    left: 10px;
    top: -5px;
    width: 10px;
    height: 5px;
    border-left: 2px solid rgba(0, 195, 255, 0.3);
    border-bottom: 2px solid rgba(0, 195, 255, 0.3);
    border-bottom-left-radius: 8px;
}

.loading-tree {
    padding: 10px;
    font-style: italic;
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.tree-help-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    padding: 8px;
    border-top: 1px solid rgba(0, 195, 255, 0.1);
    margin-top: 10px;
    line-height: 1.4;
}

/* Connection Editor Styles */
.bg-darker {
    background-color: rgba(15, 20, 25, 0.7);
}

.group-connections-list {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

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

.group-connections-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.group-connections-list::-webkit-scrollbar-thumb {
    background: var(--fiber-accent-blue);
    border-radius: 10px;
    opacity: 0.7;
}

/* Visual Tree Connection Editor Styles - Uses CSS Grid */
.visual-connection-editor {
    display: grid;
    grid-template-columns: 180px repeat(10, 1fr);
    gap: 15px;
    min-height: 500px;
    overflow-x: auto;
    padding-bottom: 10px;
}

/* Path row styling for organizing connections horizontally */
.connection-path-row {
    padding: 8px;
    margin-bottom: 12px;
    border-radius: 6px;
    background-color: rgba(0, 102, 255, 0.08);
    border: 1px dashed rgba(0, 195, 255, 0.15);
    position: relative;
    min-height: 100px; /* Fixed minimum height for all path containers */
    display: flex;
    flex-direction: column;
}

/* Connection arrows between path sections */
.connection-path-row::before {
    content: '→';
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: rgba(0, 195, 255, 0.8);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    font-weight: bold;
}

.connection-path-row:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 10px;
    right: 10px;
    height: 6px;
    background-image: linear-gradient(to right, transparent, rgba(0, 195, 255, 0.2), transparent);
}

/* Highlight for row drag and drop */
.connection-path-row.dragover {
    background-color: rgba(0, 102, 255, 0.2);
    box-shadow: inset 0 0 15px rgba(0, 195, 255, 0.3);
    border: 1px solid rgba(0, 195, 255, 0.5);
    transition: all 0.2s ease;
    cursor: copy;
}

/* No arrow for first column */
.column-body[data-column="level1"] .connection-path-row::before,
.column-body[data-column="cabinet"] .connection-path-row::before {
    display: none;
}

/* Split marker for paths that branch */
.connection-path-row.has-splits::after {
    content: '';
    background-image: linear-gradient(to right, transparent, rgba(255, 165, 0, 0.3), transparent);
}

.connection-path-row.has-splits::before {
    color: rgba(255, 165, 0, 0.8);
}

.connection-column {
    display: flex;
    flex-direction: column;
    min-width: 200px;
    background-color: rgba(20, 30, 40, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(0, 195, 255, 0.1);
    max-height: 70vh;
}

.cabinet-column {
    grid-column: 1;
    min-width: 180px;
    background-color: rgba(30, 40, 60, 0.7);
    border: 1px solid rgba(255, 165, 0, 0.3);
}

.path-label {
    font-size: 0.75rem;
    color: rgba(0, 195, 255, 0.7);
    margin-bottom: 5px;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
}

.path-label:before {
    content: '→';
    margin-right: 4px;
    font-size: 0.7rem;
}

.path-id {
    background-color: rgba(0, 102, 255, 0.2);
    border-radius: 4px;
    padding: 1px 4px;
    margin-right: 4px;
    font-size: 0.7rem;
    font-weight: bold;
}

.column-header {
    background-color: rgba(0, 102, 255, 0.2);
    border-bottom: 1px solid rgba(0, 195, 255, 0.2);
    padding: 8px 12px;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.column-title {
    font-weight: bold;
    font-size: 1rem;
    margin: 0;
    color: #fff;
}

.column-badge {
    background-color: rgba(0, 102, 255, 0.4);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.8rem;
    color: white;
}

.column-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    min-height: 200px;
}

.column-body::-webkit-scrollbar {
    width: 4px;
}

.column-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

.column-body::-webkit-scrollbar-thumb {
    background: var(--fiber-accent-blue);
    border-radius: 10px;
}

/* Combined cabinet styles */

.cabinet-column .column-header {
    background-color: rgba(255, 165, 0, 0.2);
    border-bottom: 1px solid rgba(255, 165, 0, 0.3);
}

.cabinet-column .column-title {
    color: rgba(255, 165, 0, 0.9);
}

.draggable-group {
    padding: 10px;
    margin-bottom: 8px;
    background-color: rgba(40, 50, 60, 0.9);
    border-radius: 6px;
    border: 1px solid rgba(0, 195, 255, 0.15);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: grab;
    transition: all 0.2s ease;
    position: relative;
}

.draggable-group:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 195, 255, 0.3);
}

.draggable-group.dragging {
    opacity: 0.6;
    transform: scale(0.95);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* Connection selection states */
.draggable-group.connection-source {
    border: 2px solid rgba(255, 165, 0, 0.8);
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.4);
    background-color: rgba(60, 60, 40, 0.9);
}

.draggable-group.connection-target {
    border: 2px solid rgba(0, 230, 118, 0.8);
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.4);
    background-color: rgba(40, 70, 50, 0.9);
}

.connection-indicator {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 10px;
    font-weight: bold;
    color: white;
}

.source-indicator {
    background-color: rgba(255, 165, 0, 0.8);
}

.target-indicator {
    background-color: rgba(0, 230, 118, 0.8);
}

.group-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.group-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.group-name {
    font-weight: bold;
    font-size: 0.9rem;
    flex: 1;
}

.group-house-count {
    font-size: 0.75rem;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
}

.group-details {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tubes-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
}

.tubes-count {
    display: flex;
    align-items: center;
    color: rgba(0, 195, 255, 0.9);
}

.tubes-count strong {
    color: white;
    margin: 0 2px;
}

.spare-capacity {
    font-size: 0.75rem;
    color: rgba(255, 193, 7, 0.8);
    display: flex;
    align-items: center;
}

.connection-active {
    background-color: rgba(0, 195, 255, 0.1);
    border-color: rgba(0, 195, 255, 0.3);
}

.drag-placeholder {
    height: 60px;
    background-color: rgba(0, 195, 255, 0.05);
    border: 1px dashed rgba(0, 195, 255, 0.3);
    border-radius: 6px;
    margin-bottom: 8px;
}

.connection-path {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
    display: flex;
    align-items: center;
}

.connection-path i {
    margin: 0 4px;
    font-size: 0.7rem;
}

.column-body.dragover {
    background-color: rgba(0, 195, 255, 0.05);
}

.group-icon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

/* Help box styling */
.connection-help-box {
    background-color: rgba(33, 150, 243, 0.1);
    border-left: 4px solid rgba(33, 150, 243, 0.8);
    border-radius: 0.25rem;
    position: relative;
    font-size: 0.85rem;
}

.connection-help-box ul {
    margin-top: 0.25rem;
    line-height: 1.4;
}

.connection-help-box .btn-close {
    font-size: 0.7rem;
    opacity: 0.5;
    background-color: transparent;
    border: none;
}

.connection-help-box .btn-close:hover {
    opacity: 1;
}

.connection-selector {
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 195, 255, 0.2);
}

.connection-selector:focus {
    border-color: var(--fiber-accent-blue);
    box-shadow: 0 0 0 0.25rem rgba(0, 195, 255, 0.25);
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .group-connections-list {
        max-height: 50vh;
    }
    
    .modal-dialog.modal-lg {
        max-width: 95%;
        margin: 1rem auto;
    }
}

/* Styling for unlinked POLEPED device indicators */
.unlinked-poleped-circle {
    animation: pulse-red 2s infinite;
    cursor: pointer;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 0, 0, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    }

/* Delayed tooltip styling */
.delayed-tooltip {
    transition: opacity 0.3s ease-in-out;
}

}

/* Editable names in the tree */
.editable-name {
    cursor: pointer;
    border-bottom: 1px dashed #aaa;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.editable-name:hover {
    background-color: rgba(0, 123, 255, 0.2);
}

.editable-name.editing {
    background-color: #333;
    border: 1px solid #007bff;
    outline: none;
}

/* Styling for group name badges and splice headings */
.group-name-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: bold;
    cursor: pointer;
    background-color: #555;
    color: white;
    transition: all 0.2s ease;
}

.group-name-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.splice-heading {
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.splice-heading:hover {
    text-decoration: underline;
    color: #0d6efd;
}

/* Styling for the new 2→4 upsize button */
.upsize-2to4-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upsize-2to4-btn:hover:not(:disabled) {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.upsize-2to4-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}
<line_number>1000</line_number>
/* Integrated Low-Profile Toolbar */
.integrated-toolbar {
    background: linear-gradient(145deg, rgba(8, 20, 35, 0.95), rgba(22, 38, 55, 0.95));
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(0, 195, 255, 0.1);
    border: 1px solid rgba(0, 195, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 48px;
    min-height: 48px;
    position: relative;
    overflow: visible;
}

.toolbar-section {
    gap: 6px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Section Labels */
.section-label {
    font-size: 9px;
    color: rgba(0, 195, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-right: 4px;
    margin-left: 8px;
    padding: 2px 4px;
    background: rgba(0, 195, 255, 0.1);
    border-radius: 3px;
    border: 1px solid rgba(0, 195, 255, 0.2);
    white-space: nowrap;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.section-label:first-child {
    margin-left: 0;
}

/* Tool Groups */
.tool-group {
    display: flex;
    background: rgba(10, 20, 30, 0.3);
    border-radius: 6px;
    padding: 2px;
    gap: 1px;
}

.tool-group:not(:last-child) {
    margin-right: 8px;
}

/* Toolbar Buttons */
.toolbar-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: rgba(22, 28, 40, 0.7);
    border: 1px solid rgba(0, 195, 255, 0.1);
    color: #00c6ff;
    font-size: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.toolbar-btn:hover {
    background: rgba(0, 195, 255, 0.15);
    border-color: rgba(0, 195, 255, 0.3);
    color: #40dfff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 195, 255, 0.2);
}

.toolbar-btn.compact {
    width: 36px;
}

.toolbar-btn.compact .compact-text {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.toolbar-btn.danger {
    border-color: rgba(255, 59, 59, 0.3);
    color: #ff6b6b;
}

.toolbar-btn.danger:hover {
    background: rgba(255, 59, 59, 0.15);
    border-color: rgba(255, 59, 59, 0.5);
    color: #ff8a8a;
}

.toolbar-btn.action {
    background: rgba(0, 195, 255, 0.1);
    border-color: rgba(0, 195, 255, 0.3);
}

.toolbar-btn.action:hover {
    background: rgba(0, 195, 255, 0.2);
}

/* Toggle Controls */
.toggle-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.toolbar-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
}

.toolbar-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 28px;
    height: 14px;
    background: rgba(40, 50, 65, 0.8);
    border-radius: 7px;
    position: relative;
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 195, 255, 0.2);
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    top: 1px;
    left: 2px;
    transition: all 0.2s ease;
}

.toolbar-toggle input:checked + .toggle-slider {
    background: rgba(0, 195, 255, 0.6);
    border-color: rgba(0, 195, 255, 0.4);
}

.toolbar-toggle input:checked + .toggle-slider::after {
    transform: translateX(14px);
    background: white;
}

.toggle-label {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Range Control */
.range-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.range-slider {
    width: 80px;
    height: 4px;
    background: rgba(40, 50, 65, 0.8);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #00c6ff;
    border-radius: 50%;
    cursor: pointer;
}

.range-value {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    min-width: 35px;
}

/* Layer Controls */
.layer-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.layer-toggle-group {
    display: flex;
    background: rgba(10, 20, 30, 0.4);
    border-radius: 6px;
    padding: 3px;
    gap: 2px;
}

.layer-toggle {
    position: relative;
    cursor: pointer;
}

.layer-toggle input[type="checkbox"] {
    display: none;
}

.layer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    transition: all 0.2s ease;
    background: rgba(22, 28, 40, 0.5);
    border: 1px solid rgba(0, 195, 255, 0.1);
}

.layer-toggle input:checked + .layer-icon {
    background: rgba(0, 195, 255, 0.2);
    color: #00c6ff;
    border-color: rgba(0, 195, 255, 0.3);
    box-shadow: 0 0 8px rgba(0, 195, 255, 0.2);
}

.layer-toggle:hover .layer-icon {
    background: rgba(0, 195, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.layer-actions {
    display: flex;
    gap: 2px;
}

.layer-action-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: rgba(22, 28, 40, 0.7);
    border: 1px solid rgba(0, 195, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layer-action-btn:hover {
    background: rgba(0, 195, 255, 0.15);
    color: #00c6ff;
    border-color: rgba(0, 195, 255, 0.3);
}

/* Action Group */
.action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.house-count-badge {
    background: rgba(0, 195, 255, 0.1);
    border: 1px solid rgba(0, 195, 255, 0.3);
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 10px;
    color: #00c6ff;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .tool-group {
        margin-right: 6px;
    }
    
    .toolbar-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .toggle-group {
        gap: 8px;
    }
    
    .layer-icon {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }
    
    .section-label {
        font-size: 8px;
        padding: 1px 3px;
        margin-right: 3px;
        margin-left: 6px;
    }
}

@media (max-width: 768px) {
    .integrated-toolbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 48px;
        padding: 8px 12px;
    }
    
    .toolbar-section {
        margin-bottom: 6px;
        flex-wrap: wrap;
    }
    
    .toggle-label {
        display: none;
    }
    
    .range-control {
        margin-left: 0;
    }
    
    .section-label {
        font-size: 7px;
        padding: 1px 2px;
        margin: 1px 2px;
        display: none; /* Hide section labels on mobile to save space */
    }
    
    .toolbar-btn[data-tooltip]::after,
    .toolbar-toggle[data-tooltip]::after,
    .layer-toggle[data-tooltip]::after,
    .layer-action-btn[data-tooltip]::after {
        font-size: 10px;
        padding: 4px 8px;
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .integrated-toolbar {
        padding: 6px 8px;
    }
    
    .toolbar-section {
        gap: 3px;
    }
    
    .tool-group {
        margin-right: 4px;
    }
    
    .toolbar-btn {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
}