/* Globe Container */
#globe-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    filter: brightness(1.0) contrast(1.0);
}

/* Header Stats Bar */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.2vw, 15px);
    transition: all 0.3s ease;
}

.header-toggle {
    display: none;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 18px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.header-toggle:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.6);
}

#header.collapsed #stats-container {
    display: none;
}

/* Show full labels on wide viewports (default) */
.label-full {
    display: inline;
}

.label-abbr {
    display: none;
}

/* Show toggle button and abbreviated labels on narrow viewports */
@media (max-width: 1450px) {
    .header-toggle {
        display: block;
    }

    /* Show abbreviated labels on narrow viewports */
    .label-full {
        display: none;
    }

    .label-abbr {
        display: inline;
    }
}

.header-title {
    flex-shrink: 0;
}

.header-title h1 {
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.title-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    animation: gentle-spin 20s linear infinite;
}

@keyframes gentle-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.header-title h1 a {
    color: inherit;
    text-decoration: none;
    background: inherit;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-title h1:hover {
    filter: brightness(1.2);
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

.header-subtitle {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subtitle-prefix {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    margin-right: 0;
}

.header-subtitle a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.header-subtitle a:hover {
    color: #a855f7;
    background: rgba(139, 92, 246, 0.1);
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

.subtitle-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 10px;
}

#stats-container {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex: 1;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.stat-item.clickable {
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.stat-item.clickable:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-2px);
}

.stat-item.clickable:focus {
    outline: none;
    background: rgba(139, 92, 246, 0.15);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.6);
    border-radius: 8px;
}

.stat-item.clickable.active-filter {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
}

/* Reduce padding for Total Nodes stat to free up header space */
#total-nodes-stat {
    padding: 6px 6px;
}

/* Mode toggle styling for header section titles */
.mode-toggle {
    transition: all 0.3s ease;
    opacity: 0.7;
}

.mode-toggle:hover {
    opacity: 1;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.mode-toggle.active-mode {
    opacity: 1;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* Active mode section visual enhancement */
.stat-item.section-container {
    transition: all 0.3s ease;
    position: relative;
}

.stat-item.section-container.active-section::before {
    content: '';
    position: absolute;
    left: -2px;
    top: -2px;
    bottom: -2px;
    width: 4px;
    border-radius: 2px;
    animation: borderGlow 2s ease-in-out infinite;
}

/* Purple glow for State section */
.stat-item.section-container[data-section="state"].active-section::before {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.8), rgba(168, 85, 247, 0.8));
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.6), 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Green glow for Connectivity section */
.stat-item.section-container[data-section="connectivity"].active-section::before {
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.8), rgba(16, 185, 129, 0.8));
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.6), 0 0 20px rgba(34, 197, 94, 0.3);
}

/* Subtle background gradient for active section */
.stat-item.section-container[data-section="state"].active-section {
    background: radial-gradient(ellipse at left, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
}

.stat-item.section-container[data-section="connectivity"].active-section {
    background: radial-gradient(ellipse at left, rgba(34, 197, 94, 0.08) 0%, transparent 70%);
}

@keyframes borderGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Data refresh pulse animation */
@keyframes dataRefreshPulse {
    0% {
        background: transparent;
        box-shadow: none;
    }
    50% {
        background: rgba(139, 92, 246, 0.15);
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3),
                    inset 0 0 15px rgba(139, 92, 246, 0.2);
    }
    100% {
        background: transparent;
        box-shadow: none;
    }
}

#stats-container.data-refreshed {
    animation: dataRefreshPulse 1.5s ease-in-out;
}

/* Stat change highlighting animation - bright white box pulsing */
@keyframes statChangeFlash {
    0% {
        background: transparent;
        border: 1px solid transparent;
        box-shadow: none;
    }
    10% {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6),
                    inset 0 0 15px rgba(255, 255, 255, 0.3);
    }
    20% {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
    }
    30% {
        background: transparent;
        border: 1px solid transparent;
        box-shadow: none;
    }
    40% {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6),
                    inset 0 0 15px rgba(255, 255, 255, 0.3);
    }
    50% {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
    }
    60% {
        background: transparent;
        border: 1px solid transparent;
        box-shadow: none;
    }
    70% {
        background: rgba(255, 255, 255, 0.15);
        border: 1px solid rgba(255, 255, 255, 0.9);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6),
                    inset 0 0 15px rgba(255, 255, 255, 0.3);
    }
    80% {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
    }
    90%, 100% {
        background: transparent;
        border: 1px solid transparent;
        box-shadow: none;
    }
}

.stat-item.stat-changed {
    animation: statChangeFlash 6s ease-in-out;
    /* Ensure consistent padding and border-radius for all stats during animation */
    /* Use !important to override inline styles (e.g., Peers Sampled has padding-left: 20px inline) */
    padding: 6px 10px !important;
    border-radius: 8px;
}

/* Ensure stat-changed animation takes priority over active-filter state */
.stat-item.stat-changed.active-filter {
    animation: statChangeFlash 6s ease-in-out;
    padding: 6px 10px !important;
    border-radius: 8px;
}

.stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 700;
    font-family: monospace;
    animation: pulse 2s ease-in-out infinite;
}

.stat-value.green { color: #10b981; }
.stat-value.yellow { color: #eab308; }
.stat-value.gray {
    color: #f97316;
    cursor: help;
    position: relative;
}

.stat-value.gray:hover {
    color: #fb923c;
}

.loading-spinner {
    display: inline-block;
    animation: pulse 1s ease-in-out infinite;
    color: #a855f7;
}

#other-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 15px;
    min-width: 220px;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.stat-value.gray:hover #other-tooltip {
    display: block;
}

/* Peers Sampled Tooltip */
.peers-sampled-container {
    position: relative;
}

.peers-sampled-value {
    cursor: help;
}

#peers-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 12px;
    min-width: 200px;
    max-width: 280px;
    display: none;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.peers-sampled-value:hover + #peers-tooltip:not(:empty) {
    display: block;
}

#peers-tooltip:hover {
    display: block;
}

.tooltip-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    font-family: system-ui;
}

.tooltip-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.2));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 8px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
    text-decoration: none;
    display: inline-block;
}

.header-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(168, 85, 247, 0.3));
    border-color: #8b5cf6;
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.4);
    transform: translateY(-50%) scale(1.05);
}

.header-btn.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(168, 85, 247, 0.4));
    border-color: #a855f7;
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}

#analytics-btn {
    right: 30px;
}

/* Globe Controls Panel */
#globe-controls-panel {
    position: fixed;
    top: 100px;
    right: 30px;
    z-index: 900;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: right 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    user-select: none;
    max-width: 280px;
}

#globe-controls-panel:hover {
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.3);
}

#globe-controls-panel.dragging {
    opacity: 0.9;
    cursor: grabbing;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

#globe-controls-panel.collapsed {
    padding-bottom: 12px;
}

#globe-controls-panel.collapsed .control-group {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
}

.panel-header {
    padding: 10px 14px;
    background: rgba(139, 92, 246, 0.15);
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px 10px 0 0;
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    margin: -12px -16px 10px -16px;
    transition: background 0.2s ease;
}

.panel-header:hover {
    background: rgba(139, 92, 246, 0.2);
}

.panel-header:active {
    cursor: grabbing;
}

.panel-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.panel-collapse-toggle {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.panel-collapse-toggle:hover {
    color: white;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 4px;
}

#globe-controls-panel.collapsed .panel-collapse-toggle {
    transform: rotate(-90deg);
}

.control-group {
    margin-bottom: 10px;
    max-height: 200px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.2s ease, margin 0.3s ease;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin-right: 8px;
}

/* Zoom Control */
.zoom-options {
    display: flex;
    gap: 6px;
}

.zoom-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 6px 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.zoom-option:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    color: #fff;
}

.zoom-option:focus,
.zoom-option:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.6);
}

.zoom-option.active {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.6);
    color: #fff;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.zoom-indicator {
    font-size: 8px;
}

/* Toggle Controls */
.control-toggles {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.control-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.control-toggle:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
}

.control-toggle:focus,
.control-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.6);
}

.control-toggle.active {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
}

.toggle-icon {
    font-size: 16px;
}

/* Keyboard Shortcuts Section */
/* Shortcuts tooltip container */
#shortcuts-toggle {
    position: relative;
}

.shortcuts-tooltip {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 220px;
    background: rgba(20, 20, 30, 0.98);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(0);
    z-index: 1000;
}

#shortcuts-toggle:hover .shortcuts-tooltip,
#shortcuts-toggle .shortcuts-tooltip.visible {
    opacity: 1;
    pointer-events: auto;
}

.shortcuts-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.shortcuts-tooltip-title {
    color: #a855f7;
    font-size: 12px;
    font-weight: 600;
}

.shortcuts-tooltip-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Toggle switch for enabling/disabling shortcuts */
.shortcuts-enable-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.shortcuts-enable-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 12px;
    width: 12px;
    left: 2px;
    bottom: 2px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.shortcuts-enable-toggle input:checked + .toggle-slider {
    background-color: rgba(139, 92, 246, 0.4);
    border-color: rgba(139, 92, 246, 0.6);
}

.shortcuts-enable-toggle input:checked + .toggle-slider:before {
    transform: translateX(18px);
    background-color: #a855f7;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.shortcut-item kbd {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    color: #a855f7;
    min-width: 28px;
    text-align: center;
    font-family: monospace;
}

.shortcut-item span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    flex: 1;
}

/* Globe Display Mode Legend */
#globe-legend {
    position: fixed;
    top: 100px;
    left: 420px;
    z-index: 900;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    user-select: none;
    min-width: 200px;
}

#globe-legend.dragging {
    opacity: 0.9;
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.5);
    transition: none; /* Disable all transitions during drag for smooth movement */
}

#globe-legend:hover {
    box-shadow: 0 6px 30px rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.3);
}

.legend-header {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: background 0.2s ease;
}

.legend-header:hover {
    background: rgba(139, 92, 246, 0.15);
}

.legend-header:active {
    cursor: grabbing;
}

.legend-header-title {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-tabs, .legend-title, #legend-content {
    padding: 0 15px;
}

.legend-title {
    padding-top: 15px;
}

#legend-content {
    padding-bottom: 15px;
}

.legend-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding-top: 15px;
}

.legend-tab {
    flex: 1;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.legend-tab:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
    color: #fff;
}

.legend-tab:focus,
.legend-tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.6);
}

.legend-tab.active {
    background: rgba(139, 92, 246, 0.2);
    border: 2px solid rgba(139, 92, 246, 0.6);
    color: #fff;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.legend-title {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    font-weight: 500;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

/* Left Sidebar - Node List */
#node-list {
    position: fixed;
    top: 90px;
    left: 20px;
    width: 380px;
    max-height: calc(100vh - 110px);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 50;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

#node-list.filtered {
    border-left: 3px solid #8b5cf6;
    box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.3), 0 0 20px rgba(139, 92, 246, 0.2);
}

#node-list h2 {
    font-size: 18px;
    font-weight: 600;
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.2));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.search-container {
    position: relative;
    margin: 15px;
}

#search-box {
    width: 100%;
    padding: 14px 40px 14px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

#search-box:focus,
#search-box:focus-visible {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.6);
}

#search-box::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    display: none;
    transition: all 0.2s ease;
    line-height: 1;
}

#search-clear:hover {
    color: #ef4444;
    transform: translateY(-50%) scale(1.2);
}

#search-clear.visible {
    display: block;
}

/* Filter & Sort Controls */
.filter-sort-controls {
    display: flex;
    gap: 15px;
    margin: 0 15px 15px 15px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    flex-wrap: wrap;
}

.filter-controls {
    display: flex;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
    min-width: 200px;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-dropdown, .sort-dropdown {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 100px;
}

.filter-dropdown:hover, .sort-dropdown:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
}

.filter-dropdown:focus, .sort-dropdown:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Active filter dropdown styling - glow + brighter background */
.filter-dropdown.filter-active,
.sort-dropdown.filter-active,
.area-filter-dropdown.filter-active {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4),
                0 0 20px rgba(139, 92, 246, 0.2);
    font-weight: 600;
}

@media (max-width: 1366px) {
    .filter-sort-controls {
        flex-direction: column;
    }

    .filter-controls, .sort-controls {
        width: 100%;
    }
}

/* Filter Status Bar */
#filter-status-bar {
    margin: 0 15px 10px 15px;
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.3s ease;
}

#filter-status-bar.filter-hidden {
    display: none;
}

.filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.filter-chip {
    background: rgba(139, 92, 246, 0.3);
    color: #e0e0e0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(139, 92, 246, 0.4);
}

.chip-remove {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    margin-left: 2px;
    transition: all 0.2s ease;
}

.chip-remove:hover {
    color: #ef4444;
    transform: scale(1.2);
}

.filter-count {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    margin-left: auto;
}

.clear-filters-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.clear-filters-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

#nodes-container {
    overflow-y: auto;
    flex: 1;
    padding: 0 15px 15px 15px;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.3), 0 0 12px rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.5), 0 0 20px rgba(239, 68, 68, 0.4);
    }
}

.node-item {
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 10px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
}

.node-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #8b5cf6;
    transform: translateX(5px);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.node-item.isolated {
    background: rgba(239, 68, 68, 0.05);
    border-left: 3px solid #ef4444;
    animation: pulse-glow 2s ease-in-out infinite;
}

.node-name {
    font-weight: 600;
    color: #a855f7;
    margin-bottom: 6px;
    font-family: monospace;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.peer-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.peer-badge.verified {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.peer-badge.warning {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.peer-badge.isolated {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.peer-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    font-size: 11px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.connectivity-banner:hover .peer-tooltip {
    display: block;
    animation: fadeIn 0.2s ease-in;
}

.node-ip {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
    margin-bottom: 5px;
}

.node-location {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.node-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
}

.state-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.state-dot.ready {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}
.state-dot.observing {
    background: #eab308;
    box-shadow: 0 0 10px #eab308;
}
.state-dot.other {
    background: #f97316;
    box-shadow: 0 0 10px #f97316;
}
.state-dot.isolated {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

.connectivity-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

.connectivity-status.warning {
    color: #ef4444;
}

.connectivity-status.limited {
    color: #eab308;
}

/* Right Sidebar - Cluster Modal */
#cluster-modal {
    position: fixed;
    top: 90px;
    right: 20px;
    width: 420px;
    max-height: calc(100vh - 110px);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 50;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

#cluster-modal.visible {
    display: flex;
}

#cluster-modal.flash {
    border-color: #8b5cf6;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
}

#cluster-modal-header {
    padding: 20px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.2));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

#cluster-modal h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding-right: 30px;
}

/* Area Modal Filters */
.area-modal-filters {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    align-items: center;
}

.area-filter-dropdown {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.area-filter-dropdown:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.4);
}

.area-filter-dropdown:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.area-clear-filters-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.area-clear-filters-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

#area-filter-status-bar {
    padding: 10px 20px;
    background: rgba(139, 92, 246, 0.1);
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

#area-filter-status-bar.filter-hidden {
    display: none;
}

.area-filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

#cluster-filter-status {
    padding: 8px 20px;
    background: rgba(139, 92, 246, 0.1);
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    display: none;
}

#cluster-filter-status:not(:empty) {
    display: block;
}

#cluster-status-summary {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#cluster-status-summary .status-line {
    margin: 5px 0;
}

#cluster-status-summary .status-line.primary {
    font-size: 14px;
    font-weight: 600;
}

#cluster-status-summary .status-line.secondary {
    font-size: 12px;
}

#cluster-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#cluster-modal-close:hover {
    color: #fff;
    transform: rotate(90deg);
}

#cluster-nodes-list {
    overflow-y: auto;
    flex: 1;
    padding: 15px;
}

.cluster-node-item {
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 10px;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cluster-node-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #8b5cf6;
    transform: translateX(-5px);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.cluster-node-item.isolated {
    background: rgba(239, 68, 68, 0.05);
    border-left: 3px solid #ef4444;
    animation: pulse-glow 2s ease-in-out infinite;
}

.cluster-node-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cluster-node-name {
    font-weight: 600;
    color: #a855f7;
    font-family: monospace;
    font-size: 13px;
}

.cluster-node-ip {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-family: monospace;
}

.cluster-node-location {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

.cluster-node-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
}

/* Node Details Panel */
#node-details {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    min-width: 500px;
    max-width: 650px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 100;
}

#node-details.flash {
    border-color: #8b5cf6;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
}

/* Flash animation for node list */
#node-list.flash {
    border-color: #8b5cf6;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
}

#node-details h3 {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 25px;
    font-size: 20px;
    font-weight: 600;
}

.detail-row {
    display: flex;
    margin: 16px 0;
    font-size: 15px;
}

.detail-label {
    color: rgba(255, 255, 255, 0.5);
    min-width: 100px;
    font-size: 14px;
}

.detail-value {
    color: #ffffff;
    font-size: 15px;
    flex: 1;
}

.detail-value.monospace {
    font-family: monospace;
}

.detail-value.state {
    font-weight: 600;
    font-size: 18px;
}

#close-details {
    position: absolute;
    top: 25px;
    right: 25px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

#close-details:hover {
    color: #fff;
    transform: rotate(90deg);
}

/* Loading Screen */
#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 60px;
    border-radius: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    border: 3px solid rgba(139, 92, 246, 0.3);
    border-top: 3px solid #8b5cf6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 0 30px 0;
}

#loading-text {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    max-width: 280px;
    line-height: 1.5;
    text-align: center;
}

#demo-mode-indicator {
    margin-top: 15px;
    font-size: 12px;
    color: #eab308;
    background: rgba(234, 179, 8, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

/* Credits Footer */
#credits-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 10px 20px 12px 20px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.footer-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-primary {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.footer-secondary {
    font-size: 10px;
    opacity: 0.6;
    color: rgba(255, 255, 255, 0.6);
}

#credits-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid transparent;
}

#credits-footer a:hover {
    color: #a855f7;
    border-bottom-color: rgba(168, 85, 247, 0.5);
}

#terms-link {
    color: #facc15;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.3);
    position: relative;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(250, 204, 21, 0.1);
    transition: all 0.2s ease;
}

#terms-link:hover {
    color: #fde047;
    border-bottom-color: rgba(253, 224, 71, 0.7);
    background: rgba(250, 204, 21, 0.15);
    text-shadow: 0 0 12px rgba(250, 204, 21, 0.5);
    transform: translateY(-1px);
}

.footer-separator {
    color: rgba(255, 255, 255, 0.2);
    font-size: 10px;
}

/* Toast Notification */
#toast-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: rgba(139, 92, 246, 0.35);
    backdrop-filter: blur(15px);
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    opacity: 1;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

#toast-notification.toast-warning {
    background: rgba(239, 68, 68, 0.35);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

#toast-notification.toast-loading {
    background: rgba(139, 92, 246, 0.35);
    border: 1px solid rgba(139, 92, 246, 0.5);
}

#toast-notification.toast-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-20px);
}

@keyframes toast-reappear {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
}

#toast-notification.reappear {
    animation: toast-reappear 0.3s ease;
}

.toast-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 8px;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.toast-close-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Error Overlay */
#error-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

#error-overlay.error-hidden {
    opacity: 0;
    pointer-events: none;
}

.error-content {
    max-width: 500px;
    padding: 40px;
    background: rgba(30, 30, 40, 0.9);
    border: 2px solid rgba(239, 68, 68, 0.5);
    border-radius: 16px;
    text-align: center;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

#error-title {
    color: #ef4444;
    font-size: 28px;
    margin-bottom: 15px;
}

#error-message {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    margin-bottom: 10px;
}

.error-subtext {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-bottom: 20px;
}

.error-btn {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

.error-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.error-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.error-links a {
    color: #a855f7;
    text-decoration: none;
    font-size: 14px;
}

.error-links a:hover {
    text-decoration: underline;
}

.link-separator {
    color: rgba(255, 255, 255, 0.3);
}

/* Personal Branding */
#personal-branding {
    position: fixed;
    bottom: 60px;
    right: 20px;
    z-index: 950;
}

#branding-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

#branding-text:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* About Modal - Rebuilt from scratch for minimal, tight fit */
#about-modal {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    width: fit-content;
    min-width: 240px;
    max-width: 280px;
    background: rgba(20, 20, 30, 0.98);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#about-modal.about-modal-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.about-close-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.about-close-btn:hover {
    color: #ef4444;
}

#about-modal h4 {
    color: #a855f7;
    margin: 0 0 8px 0;
    padding-right: 20px;
    font-size: 14px;
}

.about-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.about-section-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 600;
    margin: 6px 0 4px 0;
}

.about-link-item {
    margin: 0;
}

.about-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    display: block;
    margin-bottom: 2px;
}

.about-link-item a {
    color: #a855f7;
    text-decoration: none;
    font-size: 13px;
}

.about-link-item a:hover {
    text-decoration: underline;
}

.kofi-container {
    margin: 4px 0 0 0;
}

.kofi-btn {
    display: inline-block;
    background: linear-gradient(135deg, #ff5e5b, #ff813f);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.kofi-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 94, 91, 0.4);
}

.crypto-donations {
    margin: 4px 0 0 0;
}

.crypto-btn {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.crypto-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* Terms Acceptance Modal (First Visit - Blocking) */
#terms-acceptance-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#terms-acceptance-modal.terms-acceptance-hidden {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.terms-acceptance-content {
    position: relative;
    max-width: 800px;
    max-height: 90vh;
    background: rgba(20, 20, 30, 0.98);
    border: 2px solid rgba(239, 68, 68, 0.6);
    border-radius: 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.9);
}

.terms-acceptance-content h3 {
    color: #ef4444;
    margin: 0;
    padding: 25px 30px;
    font-size: 24px;
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

.terms-acceptance-text {
    padding: 25px 30px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 200px);
    position: relative;
}

.terms-acceptance-text::-webkit-scrollbar {
    width: 8px;
}

.terms-acceptance-text::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.terms-acceptance-text::-webkit-scrollbar-thumb {
    background: rgba(239, 68, 68, 0.4);
    border-radius: 4px;
}

.terms-acceptance-text::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 68, 68, 0.6);
}

.terms-acceptance-text h4 {
    color: #facc15;
    margin: 20px 0 10px 0;
    font-size: 16px;
}

.terms-acceptance-text h4:first-of-type {
    margin-top: 0;
}

.terms-acceptance-text p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 10px 0;
    font-size: 14px;
}

.terms-acceptance-text ul {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 10px 0;
    padding-left: 25px;
    font-size: 14px;
}

.terms-acceptance-text li {
    margin: 5px 0;
}

.terms-acceptance-text a {
    color: #a855f7;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.terms-acceptance-text a:hover {
    color: #c084fc;
    border-bottom-color: rgba(192, 132, 252, 0.5);
}

.terms-acceptance-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.terms-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
    user-select: none;
    position: relative;
}

.terms-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.terms-checkbox-label input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.terms-checkbox-label input[type="checkbox"]:disabled ~ span {
    opacity: 0.5;
}

/* Scroll hint - shows when checkbox is disabled */
.terms-checkbox-label::before {
    content: '⬇️ Please scroll to the bottom to continue';
    position: absolute;
    top: -30px;
    left: 0;
    font-size: 12px;
    color: #facc15;
    font-weight: 600;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.terms-checkbox-label input[type="checkbox"]:not(:disabled) ~ .terms-checkbox-label::before,
.terms-checkbox-label:has(input[type="checkbox"]:not(:disabled))::before {
    opacity: 0;
    pointer-events: none;
}

.terms-checkbox-label span {
    flex: 1;
}

.terms-accept-btn {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.terms-accept-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.terms-accept-btn:disabled {
    background: rgba(139, 92, 246, 0.3);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Terms of Use Modal (Re-accessible) */
#terms-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#terms-modal.terms-modal-hidden {
    opacity: 0;
    pointer-events: none;
}

.terms-modal-content {
    position: relative;
    max-width: 700px;
    max-height: 85vh;
    background: rgba(20, 20, 30, 0.98);
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 16px;
    padding: 30px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.terms-modal-content::-webkit-scrollbar {
    width: 8px;
}

.terms-modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.terms-modal-content::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.4);
    border-radius: 4px;
}

.terms-modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.6);
}

.terms-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.terms-close-btn:hover {
    color: #ef4444;
    transform: rotate(90deg);
}

#terms-modal h3 {
    color: #a855f7;
    margin: 0 0 20px 0;
    font-size: 24px;
    padding-right: 40px;
}

.terms-section h4 {
    color: #facc15;
    margin: 20px 0 10px 0;
    font-size: 16px;
}

.terms-section h4:first-child {
    margin-top: 0;
}

.terms-section p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 10px 0;
    font-size: 14px;
}

.terms-section ul {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 10px 0;
    padding-left: 25px;
    font-size: 14px;
}

.terms-section li {
    margin: 5px 0;
}

.terms-section a {
    color: #a855f7;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.terms-section a:hover {
    color: #c084fc;
    border-bottom-color: rgba(192, 132, 252, 0.5);
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   Desktop-focused responsive design for different monitor sizes
   ============================================================================ */

/* Default (1366px - Laptop/Small Desktop) */
/* Base styles above are optimized for this size */

/* 1920px - Standard Desktop/1080p */
@media (min-width: 1920px) {
    #header {
        padding: 15px 30px;
        gap: 35px;
    }

    .header-title h1 {
        font-size: 28px;
    }

    .header-subtitle {
        font-size: 12px;
    }

    #stats-container {
        gap: 35px;
    }

    .stat-value {
        font-size: 30px;
    }

    .stat-label {
        font-size: 11px;
    }

    /* Sidebar with max-width to prevent excessive stretching */
    #node-list {
        width: 420px;
        max-width: 450px;
        top: 100px;
        left: 30px;
    }

    #node-list h2 {
        font-size: 20px;
        padding: 22px;
    }

    .node-item {
        padding: 16px;
    }

    .node-name {
        font-size: 14px;
    }

    .node-ip, .node-location {
        font-size: 13px;
    }

    /* Globe Controls Panel */
    #globe-controls-panel {
        top: 110px;
        right: 40px;
        padding: 14px 18px;
    }

    .panel-title {
        font-size: 12px;
    }

    .zoom-option, .control-toggle {
        font-size: 12px;
        padding: 8px 14px;
    }

    .toggle-label {
        font-size: 11px;
    }

    /* Globe Legend */
    #globe-legend {
        left: 460px;
    }

    /* Cluster modal */
    #cluster-modal {
        width: 460px;
        max-width: 500px;
        top: 100px;
        right: 30px;
    }

    /* Node details panel */
    #node-details {
        padding: 35px;
        min-width: 600px;
        max-width: 750px;
    }

    #node-details h3 {
        font-size: 22px;
    }

    .detail-row {
        font-size: 16px;
    }
}

/* 2560px - 2K/1440p */
@media (min-width: 2560px) {
    #header {
        padding: 22px 60px;
        gap: 60px;
    }

    .header-title h1 {
        font-size: 38px;
    }

    .header-subtitle {
        font-size: 13px;
        gap: 10px;
    }

    #stats-container {
        gap: 60px;
    }

    .stat-value {
        font-size: 40px;
    }

    .stat-label {
        font-size: 12px;
    }

    /* Sidebar with max-width */
    #node-list {
        width: 450px;
        max-width: 500px;
        top: 110px;
        left: 40px;
    }

    #node-list h2 {
        font-size: 22px;
        padding: 24px;
    }

    .search-container {
        margin: 18px;
    }

    #search-box {
        padding: 16px 45px 16px 16px;
        font-size: 15px;
    }

    .node-item {
        padding: 18px;
        margin-bottom: 12px;
    }

    .node-name {
        font-size: 15px;
    }

    .node-ip, .node-location {
        font-size: 14px;
    }

    /* Globe Controls Panel */
    #globe-controls-panel {
        top: 120px;
        right: 50px;
        padding: 16px 20px;
    }

    .panel-title {
        font-size: 13px;
    }

    .control-label {
        font-size: 11px;
    }

    .zoom-option {
        font-size: 13px;
        padding: 9px 14px;
    }

    .control-toggle {
        font-size: 13px;
        padding: 10px 14px;
    }

    .toggle-label {
        font-size: 11px;
    }

    /* Globe Legend */
    #globe-legend {
        left: 500px;
        top: 110px;
    }

    /* Cluster modal */
    #cluster-modal {
        width: 500px;
        max-width: 550px;
        top: 110px;
        right: 40px;
    }

    #cluster-modal h3 {
        font-size: 20px;
    }

    .cluster-node-item {
        padding: 16px;
    }

    /* Node details panel */
    #node-details {
        padding: 40px;
        min-width: 650px;
        max-width: 850px;
        bottom: 40px;
    }

    #node-details h3 {
        font-size: 24px;
        margin-bottom: 30px;
    }

    .detail-row {
        font-size: 17px;
        margin: 18px 0;
    }

    .detail-label {
        font-size: 15px;
        min-width: 120px;
    }

    .detail-value {
        font-size: 16px;
    }

    /* Footer */
    #credits-footer {
        padding: 14px 25px;
        font-size: 12px;
        gap: 15px;
    }

    #personal-branding {
        bottom: 58px;
        right: 30px;
    }

    #branding-text {
        font-size: 12px;
        padding: 7px 12px;
    }
}

/* 3440px - Ultra-wide */
@media (min-width: 3440px) {
    #header {
        padding: 25px 80px;
        gap: 70px;
    }

    .header-title h1 {
        font-size: 42px;
    }

    .header-subtitle {
        font-size: 14px;
        gap: 12px;
    }

    #stats-container {
        gap: 70px;
    }

    .stat-value {
        font-size: 44px;
    }

    .stat-label {
        font-size: 13px;
    }

    /* Sidebar with max-width to prevent excessive stretching */
    #node-list {
        width: 480px;
        max-width: 500px;
        top: 120px;
        left: 50px;
    }

    #node-list h2 {
        font-size: 24px;
        padding: 26px;
    }

    .search-container {
        margin: 20px;
    }

    #search-box {
        padding: 18px 50px 18px 18px;
        font-size: 16px;
    }

    .node-item {
        padding: 20px;
        margin-bottom: 14px;
    }

    .node-name {
        font-size: 16px;
    }

    .node-ip, .node-location {
        font-size: 15px;
    }

    /* Globe Controls Panel */
    #globe-controls-panel {
        top: 130px;
        right: 60px;
        padding: 18px 22px;
    }

    .panel-title {
        font-size: 14px;
    }

    .control-label {
        font-size: 12px;
    }

    .zoom-option {
        font-size: 14px;
        padding: 10px 16px;
    }

    .control-toggle {
        font-size: 14px;
        padding: 11px 16px;
    }

    .toggle-icon {
        font-size: 16px;
    }

    .toggle-label {
        font-size: 12px;
    }

    /* Globe Legend */
    #globe-legend {
        left: 540px;
        top: 130px;
        padding: 18px;
    }

    .legend-tab {
        font-size: 13px;
        padding: 9px 14px;
    }

    .legend-item {
        font-size: 14px;
    }

    /* Cluster modal */
    #cluster-modal {
        width: 520px;
        max-width: 550px;
        top: 120px;
        right: 50px;
    }

    #cluster-modal h3 {
        font-size: 22px;
    }

    #cluster-modal-header {
        padding: 24px;
    }

    .cluster-node-item {
        padding: 18px;
        margin-bottom: 12px;
    }

    /* Node details panel */
    #node-details {
        padding: 45px;
        min-width: 700px;
        max-width: 900px;
        bottom: 50px;
    }

    #node-details h3 {
        font-size: 26px;
        margin-bottom: 32px;
    }

    .detail-row {
        font-size: 18px;
        margin: 20px 0;
    }

    .detail-label {
        font-size: 16px;
        min-width: 130px;
    }

    .detail-value {
        font-size: 17px;
    }

    /* Footer */
    #credits-footer {
        padding: 16px 30px;
        font-size: 13px;
        gap: 18px;
    }

    #personal-branding {
        bottom: 65px;
        right: 40px;
    }

    #branding-text {
        font-size: 13px;
        padding: 8px 14px;
    }
}
