body {
    margin: 0;
    padding: 0;
    background: rgba(25.6, 25.6, 25.6, 255);
    font-family: Arial, sans-serif;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    image-rendering: auto;
}

.controls {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    display: flex;
    gap: 15px;
    align-items: center;
}

.parameterSlider {
    width: 200px;
    margin: 0 10px;
}

.parameterSliderLabel {
    color: rgb(255, 255, 255);
    font-size: 14px;
    margin-right: 10px;
}

.parameterSliderValue {
    color: #4CAF50;
    font-size: 14px;
    margin-right: 10px;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-input-label {
    background: #4CAF50;
    color: rgb(255, 255, 255);
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.file-input-label:hover {
    background: #45a049;
}

.reset-button {
    background: #2196F3;
    color: rgb(255, 255, 255);
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.reset-button:hover {
    background: #1976D2;
}

.demo-button {
    background: #FF9800;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    margin-left: 10px;
}

.demo-button:hover {
    background: #F57C00;
}

/* Old instructions styles removed - replaced with collapsible instructions panel */

.status {
    position: absolute;
    bottom: 20px;
    left: 20px;
    padding: 10px 20px;
    border-radius: 5px;
    color: rgb(255, 255, 255);
    font-size: 14px;
    z-index: 100;
    display: none;
}

.status.success {
    background: #4CAF50;
}

.status.info {
    background: #2a6afe;
}

.status.error {
    background: #f44336;
}



/* Radius Controls Styles */
.radius-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    color: white;
}

.slider-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slider-control label {
    font-size: 12px;
    color: rgb(255, 255, 255);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-control input[type="range"] {
    width: 150px;
    height: 5px;
    background: #666666;
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    width: 15px;
    height: 15px;
    background: #000000;
    border-radius: 50%;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.slider-control input[type="range"]::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: #000000;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-control span {
    color: #4CAF50;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

/* Sidebar Menu System Styles */
.menu-toggle {
    background: #673AB7;
    color: white;
    padding: 0;
    border: none;
    border-radius: 50% 0 0 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

.menu-toggle:hover {
    background: #5E35B1;
    right: 5px;
}

.menu-toggle.open {
    right: 400px;
    border-radius: 0 50% 50% 0;
    transform: translateY(-50%) rotate(180deg);
}

.menu-toggle.open:hover {
    right: 395px;
}

.settings-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #0f172a;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1100;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(59, 130, 246, 0.2);
}

.settings-sidebar.open {
    right: 0;
}

.sidebar-header {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #673AB7 #f1f1f1;
}

.sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #673AB7;
    border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #5E35B1;
}

.menu-section {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 2px;
}

.section-header {
    background: #673AB7;
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
}

.section-header:hover {
    background: #5E35B1;
}

.section-header::after {
    content: '▼';
    transition: transform 0.3s;
}

.section-header.collapsed::after {
    transform: rotate(-90deg);
}

.section-content {
    padding: 18px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.section-content.collapsed {
    max-height: 0;
    padding: 0 18px;
}

.menu-subsection {
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    margin-bottom: 15px;
}

.subsection-header {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #673AB7;
    font-weight: 600;
}

.subsection-content {
    margin-left: 8px;
    padding-bottom: 10px;
}

.control-group {
    margin-bottom: 18px;
    clear: both;
}

.control-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    line-height: 1.2;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #673AB7;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #673AB7;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-value {
    text-align: right;
    font-weight: 600;
    color: #673AB7;
    background: #f8f9fa;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.color-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.control-color {
    width: 50px;
    height: 30px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    background: none;
    outline: none;
    flex-shrink: 0;
}

.control-color::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.control-color::-webkit-color-swatch-wrapper {
    padding: 0;
    border: none;
}

.menu-footer {
    background: #0080ff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #0080ff;
    flex-shrink: 0;
}

.menu-button {
    padding: 10px 20px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    flex: 1;
    background: rgba(59, 130, 246, 0.1);
    color: #e2e8f0;
}

.menu-button.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.menu-button.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.menu-button.secondary {
    background: rgba(71, 85, 105, 0.6);
    color: #cbd5e1;
    border-color: rgba(71, 85, 105, 0.4);
}

.menu-button.secondary:hover {
    background: rgba(71, 85, 105, 0.8);
    border-color: rgba(71, 85, 105, 0.6);
    color: #e2e8f0;
}

/* File Info Styles */
.file-info {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    border: 1px solid #e9ecef;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #495057;
    font-size: 12px;
}

.info-value {
    color: #673AB7;
    font-weight: 500;
    font-size: 12px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

/* Log Section Styles */
.log-container {
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.log-display {
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.4;
    padding: 10px;
    height: 200px;
    overflow-y: auto;
    border-bottom: 1px solid #e9ecef;
}

.log-display::-webkit-scrollbar {
    width: 6px;
}

.log-display::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.log-display::-webkit-scrollbar-thumb {
    background: #673AB7;
    border-radius: 3px;
}

.log-entry {
    margin-bottom: 2px;
    padding: 2px 0;
    word-wrap: break-word;
}

.log-entry.log-success {
    color: #4CAF50;
}

.log-entry.log-error {
    color: #f44336;
}

.log-entry.log-info {
    color: #2196F3;
}

.log-entry.log-warning {
    color: #FF9800;
}

.log-timestamp {
    color: #888;
    margin-right: 8px;
    font-size: 10px;
}

.log-message {
    color: inherit;
}

.log-controls {
    padding: 8px;
    display: flex;
    gap: 8px;
    background: #ffffff;
}

.log-button {
    padding: 6px 12px;
    border: 1px solid #673AB7;
    border-radius: 4px;
    background: transparent;
    color: #673AB7;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
}

.log-button:hover {
    background: #673AB7;
    color: white;
}

/* Edge Information Panel Styles */
.edge-info-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 200;
    min-width: 320px;
    max-width: 400px;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    font-family: Arial, sans-serif;
    pointer-events: auto; /* Ensure panel can capture events */
}

.edge-info-panel.collapsed .edge-info-content {
    display: none;
}

.edge-info-header {
    background: #673AB7;
    color: white;
    padding: 12px 15px;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.edge-info-header:hover {
    background: #5E35B1;
}

.edge-info-title {
    font-weight: bold;
    font-size: 14px;
}

.edge-info-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 12px;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.3s ease;
}

.edge-info-panel:not(.collapsed) .edge-info-toggle {
    transform: rotate(180deg);
}

.edge-info-content {
    padding: 15px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 0 0 6px 6px;
}

.edge-info-item {
    margin-bottom: 8px;
    font-size: 16px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.edge-info-item:last-child {
    margin-bottom: 0;
}

.edge-info-item strong {
    color: #673AB7;
    min-width: 90px;
    font-weight: 600;
    margin-right: 8px;
}

.edge-info-item span {
    color: #555;
    font-weight: 500;
    text-align: right;
    flex: 1;
    word-break: break-all;
    font-family: Arial, Helvetica, sans-serif, monospace;
    font-size: 12px;
    line-height: 1.3;
}

/* Hide panel when no edge is selected */
.edge-info-panel.hidden {
    display: none;
}

/* Multiple Edge Information Panel Styles */
.multiple-edge-info-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 200;
    min-width: 400px;
    max-width: 500px;
    max-height: 70vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    font-family: Arial, sans-serif;
    pointer-events: auto; /* Ensure panel can capture events */
}

.multiple-edge-info-panel.collapsed .multiple-edge-info-content {
    display: none;
}

.multiple-edge-info-panel.hidden {
    display: none;
}

.multiple-edge-info-header {
    background: #673AB7;
    color: white;
    padding: 12px 15px;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 1;
}

.multiple-edge-info-header:hover {
    background: #5E35B1;
}

.multiple-edge-info-title {
    font-weight: bold;
    font-size: 14px;
    flex: 1;
}

.multiple-edge-info-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 12px;
    cursor: pointer;
    padding: 2px;
    transition: transform 0.3s ease;
}

.multiple-edge-info-content {
    padding: 15px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 0 0 6px 6px;
}

.edge-selection-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.edge-control-btn {
    background: #673AB7;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.edge-control-btn:hover {
    background: #5E35B1;
}

.edges-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edge-tab {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
}

.edge-tab:hover {
    border-color: #673AB7;
    box-shadow: 0 2px 4px rgba(103, 58, 183, 0.1);
}

.edge-tab-header {
    background: #f5f5f5;
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    position: relative;
}

.edge-tab-header:hover {
    background: #eeeeee;
}

.edge-tab-title {
    font-weight: bold;
    color: #673AB7;
    font-size: 14px;
}

.edge-tab-summary {
    font-size: 12px;
    color: #666;
    margin-left: 10px;
    flex: 1;
}

.edge-tab-toggle {
    background: none;
    border: none;
    color: #673AB7;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    transition: transform 0.3s ease;
}

.edge-tab-remove {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: background-color 0.3s;
}

.edge-tab-remove:hover {
    background: #d32f2f;
}

.edge-tab-content {
    padding: 12px;
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
}

.edge-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edge-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 4px 0;
}

.edge-info-label {
    font-weight: 600;
    color: #673AB7;
    min-width: 90px;
    font-size: 12px;
}

.edge-info-value {
    color: #555;
    font-size: 12px;
    font-family: monospace;
    text-align: right;
    flex: 1;
    margin-left: 10px;
    word-break: break-all;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .settings-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .menu-toggle.open {
        right: 100%;
        transform: translateY(-50%) translateX(100%) rotate(180deg);
    }
    
    .menu-toggle.open:hover {
        right: calc(100% - 5px);
        transform: translateY(-50%) translateX(calc(100% - 5px)) rotate(180deg);
    }
    
    .sidebar-header h2 {
        font-size: 18px;
    }
    
    .section-content {
        padding: 12px;
    }
    
    .menu-footer {
        padding: 12px;
    }

    .edge-info-panel {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }

    .multiple-edge-info-panel {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
        max-height: 60vh;
    }
    
    .edge-tab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .edge-tab-summary {
        margin-left: 0;
    }
    
    .edge-info-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .edge-info-value {
        text-align: left;
        margin-left: 0;
        margin-top: 2px;
    }
}

/* Canvas adjustment when sidebar is open */
body.sidebar-open {
    margin-right: 0;
}

@media (min-width: 769px) {
    body.sidebar-open canvas {
        width: calc(100vw - 400px);
    }
}

/* Hide original controls when menu is available */
.controls .parameterSlider {
    display: none;
}

/* Menu Toggle Button */
.menu-toggle {
    background: #673AB7;
    color: white;
    padding: 0;
    border: none;
    border-radius: 50% 0 0 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

.menu-toggle:hover {
    background: #5E35B1;
    right: 5px;
}

.menu-toggle.open {
    right: 400px;
    border-radius: 0 50% 50% 0;
    transform: translateY(-50%) rotate(180deg);
}

.menu-toggle.open:hover {
    right: 395px;
}

/* Settings Sidebar */
.settings-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    pointer-events: auto; /* Ensure menu can capture events */
}

.settings-sidebar.open {
    right: 0;
}



.sidebar-header {
    background: #673AB7;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #673AB7 #f1f1f1;
}

.sidebar-content::-webkit-scrollbar {
    width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #673AB7;
    border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #5E35B1;
}

/* Menu Sections */
.menu-section {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 2px;
}

.section-header {
    background: #673AB7;
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
}

.section-header:hover {
    background: #5E35B1;
}

.section-header::after {
    content: '▼';
    transition: transform 0.3s;
}

.section-header.collapsed::after {
    transform: rotate(-90deg);
}

.section-content {
    padding: 18px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.section-content.collapsed {
    max-height: 0;
    padding: 0 18px;
}

/* Control Groups */
.control-group {
    margin-bottom: 18px;
    clear: both;
}

.control-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    line-height: 1.2;
}

/* Menu Buttons */
.menu-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.menu-button.primary {
    background: #673AB7;
    color: white;
}

.menu-button.primary:hover {
    background: #5E35B1;
}

.menu-button.secondary {
    background: #6c757d;
    color: white;
}

.menu-button.secondary:hover {
    background: #5a6268;
}

/* Slider Controls */
.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #673AB7;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #673AB7;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-value {
    text-align: right;
    font-weight: 600;
    color: #ffffff;
    background: #f8f9fa;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
}

/* File Input Wrapper for Menu */
.menu-section .file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
}

.menu-section .file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.menu-section .file-input-wrapper label {
    display: block;
    cursor: pointer;
    transition: all 0.3s;
}



/* Instructions Panel Styles */
.instructions-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #673AB7;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 500px;
    min-width: 300px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(5px);
    pointer-events: auto; /* Ensure panel can capture events */
}

.instructions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #673AB7;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    user-select: none;
    border-bottom: none;
}

.instructions-header:hover {
    background: #5E35B1;
}

.instructions-title {
    font-weight: bold;
    font-size: 18px;
    color: white;
}

.instructions-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instructions-content {
    padding: 16px;
    font-size: 15px;
    line-height: 1.5;
    overflow-y: auto;
    flex: 1;
    background: rgba(255, 255, 255, 0.98);
    color: #333;
    scrollbar-width: thin;
    scrollbar-color: #673AB7 rgba(255, 255, 255, 0.1);
}

.instructions-content::-webkit-scrollbar {
    width: 8px;
}

.instructions-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

.instructions-content::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.6);
    border-radius: 4px;
}

.instructions-content::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.8);
}

.instructions-content h3 {
    margin: 0 0 12px 0;
    color: #3b82f6;
    font-size: 18px;
}

.instructions-content h4 {
    margin: 16px 0 8px 0;
    color: #60a5fa;
    font-size: 16px;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    padding-bottom: 4px;
}

.instructions-content p {
    margin: 8px 0;
    color: #000000;
    font-size: 15px;
}

.instructions-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.instructions-content li {
    margin: 4px 0;
    color: #e0e0e0;
    font-size: 14px;
}

.info-section {
    margin-bottom: 16px;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 8px 0;
}

.control-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 13px;
    color: #000000;
}

.instructions-content code {
    background: rgba(59, 130, 246, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Link styling for instructions panel */
.instructions-content a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

.instructions-content a:hover {
    color: #60a5fa;
    border-bottom-color: rgba(96, 165, 250, 0.6);
}

.instructions-content a:visited {
    color: #3b82f6;
}

.instructions-content a:visited:hover {
    color: #3b82f6;
}

/* Instructions panel control styling */
.instructions-panel .control-group {
    margin-bottom: 18px;
    clear: both;
}

.instructions-panel .control-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #673AB7;
    font-size: 13px;
    line-height: 1.2;
}

.instructions-panel .slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions-panel .control-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: rgba(59, 130, 246, 0.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    accent-color: #3b82f6;
}

.instructions-panel .control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.instructions-panel .control-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #3b82f6;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.instructions-panel .slider-value {
    text-align: right;
    font-weight: 600;
    color: #673AB7;
    background: rgba(103, 58, 183, 0.1);
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    border: 1px solid rgba(103, 58, 183, 0.2);
}

.instructions-panel .menu-button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.instructions-panel .menu-button.primary {
    background: #673AB7;
    color: white;
}

.instructions-panel .menu-button.primary:hover {
    background: #5E35B1;
}

.instructions-panel .file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
}

.instructions-panel .file-input-wrapper input[type=file] {
    position: absolute;
    left: -9999px;
}

.instructions-panel .file-input-wrapper label {
    display: block;
    cursor: pointer;
    transition: all 0.3s;
}

/* Responsive adjustments for instructions panel */
@media (max-width: 768px) {
    .instructions-panel {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        min-width: auto;
        max-height: 80vh;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .instructions-content {
        padding: 12px;
        font-size: 14px;
    }
}

/* Color scheme overrides to ensure consistent dark theme with blue accents */
.menu-section {
    background: #1e293b !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1) !important;
}

.section-header {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.1) !important;
}

.section-header:hover {
    background: #334155 !important;
    color: #3b82f6 !important;
}

.section-content {
    background: #0f172a !important;
    color: #000000 !important;
}

.control-label {
    color: #000000 !important;
}

.slider-value {
    color: #000000 !important;
    background: rgba(59, 130, 246, 0.1) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
}

.control-slider {
    accent-color: #000000 !important;
}

/* Edge info panel colors */
.edge-info-panel {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.edge-info-header {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2) !important;
}

.edge-info-title {
    color: #3b82f6 !important;
}

.edge-info-toggle {
    color: #3b82f6 !important;
}

.edge-info-content {
    background: #0f172a !important;
    color: #e2e8f0 !important;
}

/* Menu toggle button colors */
.menu-toggle {
    background: rgba(59, 130, 246, 0.9) !important;
    color: white !important;
    border: 1px solid rgba(59, 130, 246, 0.4) !important;
}

.menu-toggle:hover {
    background: rgba(37, 99, 235, 0.9) !important;
    border-color: rgba(37, 99, 235, 0.6) !important;
}

/* Fix white borders in control elements */
.file-info, .log-wrapper {
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    background: rgba(15, 23, 42, 0.5) !important;
}

.log-container {
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    background: #0f172a !important;
}

/* Target specific elements with white borders */
.info-item, .file-input-wrapper, .control-group, .log-display {
    border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Remove borders from form elements */
input[type="range"], input[type="file"] {
    border: none !important;
}

/* Fix any remaining light/white borders */
.menu-section .fps-display {
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
}

/* Mobile Device Warning Styles */
.mobile-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-warning.show {
    display: flex !important;
}

.mobile-warning-content {
    background: #1e293b;
    color: #e2e8f0;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(59, 130, 246, 0.4);
    max-width: 90%;
    width: 480px;
    text-align: left;
    animation: slideIn 0.4s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mobile-warning-content h3 {
    margin: 0 0 20px 0;
    color: #3b82f6;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

.mobile-warning-content p {
    margin: 16px 0;
    line-height: 1.6;
    font-size: 16px;
}

.mobile-warning-content p strong {
    color: #60a5fa;
}

.mobile-warning-content ul {
    margin: 12px 0;
    padding-left: 20px;
    line-height: 1.6;
}

.mobile-warning-content li {
    margin: 8px 0;
    font-size: 15px;
    color: #cbd5e1;
}

.mobile-warning-buttons {
    display: flex;
    margin-top: 30px;
    justify-content: center;
}

.mobile-warning-button {
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

.mobile-warning-button.secondary {
    background: rgba(71, 85, 105, 0.6);
    color: #cbd5e1;
    border: 1px solid rgba(71, 85, 105, 0.4);
}

.mobile-warning-button.secondary:hover {
    background: rgba(71, 85, 105, 0.8);
    border-color: rgba(71, 85, 105, 0.6);
    color: #e2e8f0;
    transform: translateY(-1px);
}

/* Show warning on mobile devices by default */
@media (max-width: 768px), (hover: none) {
    .mobile-warning {
        display: flex;
    }
    
    /* Hide main content on mobile until warning is dismissed */
    #canvas,
    #instructionsPanel,
    #edgeInfoPanel {
        display: none;
    }
}

/* Responsive adjustments for mobile warning */
@media (max-width: 480px) {
    .mobile-warning-content {
        padding: 30px 20px;
        width: 95%;
        border-radius: 12px;
    }
    
    .mobile-warning-content h3 {
        font-size: 20px;
    }
    
    .mobile-warning-content p {
        font-size: 14px;
    }
    
    .mobile-warning-button {
        min-width: 100px;
    }
}

/* Comprehensive white border fixes */
.settings-sidebar * {
    border-color: rgba(59, 130, 246, 0.2) !important;
}

.settings-sidebar .menu-section,
.settings-sidebar .section-content,
.settings-sidebar .control-group,
.settings-sidebar .slider-container,
.settings-sidebar .file-input-wrapper {
    border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Remove borders from elements that shouldn't have them */
.settings-sidebar .control-label,
.settings-sidebar .slider-value {
    border: none !important;
}

/* Aggressive white border removal */
.settings-sidebar input,
.settings-sidebar button,
.settings-sidebar label,
.settings-sidebar div,
.settings-sidebar span {
    border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Specifically target problematic elements */
.slider-container, .control-group, .file-input-wrapper label {
    border: none !important;
    outline: none !important;
}

/* Override any default input styling */
input[type="range"]:focus,
input[type="file"]:focus,
button:focus {
    outline: none !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
}

/* Make sure no element has white/light borders */
.settings-sidebar [style*="border"] {
    border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Override all problematic light colors found in original styles */
.settings-sidebar .menu-section,
.settings-sidebar .section-content {
    background: #0f172a !important;
}

.settings-sidebar {
    background: #0f172a !important;
}

.settings-sidebar .sidebar-header {
    background: #1e293b !important;
}

.settings-sidebar .section-header {
    background: #1e293b !important;
}

/* Fix specific elements with light backgrounds/borders */
.settings-sidebar .info-item,
.settings-sidebar .log-wrapper,
.settings-sidebar .file-info {
    background: rgba(15, 23, 42, 0.5) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
}

/* Override any #ddd, #e9ecef, #f8f9fa backgrounds or borders */
*[style*="#ddd"], *[style*="#e9ecef"], *[style*="#f8f9fa"] {
    background: #0f172a !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Ensure menu buttons have proper backgrounds */
.settings-sidebar .menu-button.primary {
    background: #3b82f6 !important;
    color: white !important;
}

.settings-sidebar .menu-button.secondary {
    background: rgba(71, 85, 105, 0.6) !important;
    color: #000000 !important;
}

/* Remove animation from collapsible menu buttons */
.section-header::after {
    transition: none !important;
    transform: none !important;
}

.section-header.collapsed::after {
    transition: none !important;
    transform: rotate(-90deg) !important;
}

/* Remove all hover transform animations */
.settings-sidebar *:hover {
    transform: none !important;
}

/* Specifically override menu button hover transforms */
.menu-button:hover,
.menu-button.primary:hover,
.menu-button.secondary:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Remove all button transitions */
.menu-button, .fps-toggle-overlay, .menu-toggle {
    transition: background-color 0.2s, border-color 0.2s !important;
}

/* Fix slider styling to remove white elements */
input[type="range"] {
    background: transparent !important;
    border: none !important;
}

input[type="range"]::-webkit-slider-track {
    background: #666666 !important;
    border: none !important;
}

input[type="range"]::-webkit-slider-thumb {
    background: #000000 !important;
    border: none !important;
}

input[type="range"]::-moz-range-track {
    background: #666666 !important;
    border: none !important;
}

input[type="range"]::-moz-range-thumb {
    background: #000000 !important;
    border: none !important;
}

/* Force all slider tracks to be visible gray with highest specificity */
.slider-control input[type="range"],
.control-slider,
.instructions-panel .control-slider,
input[type="range"] {
    background: #666666 !important;
}

.slider-control input[type="range"]::-webkit-slider-track,
.control-slider::-webkit-slider-track,
.instructions-panel .control-slider::-webkit-slider-track,
input[type="range"]::-webkit-slider-track {
    background: #666666 !important;
}

.slider-control input[type="range"]::-moz-range-track,
.control-slider::-moz-range-track,
.instructions-panel .control-slider::-moz-range-track,
input[type="range"]::-moz-range-track {
    background: #666666 !important;
}

/* Force all slider thumbs to be blue with highest specificity */
.slider-control input[type="range"]::-webkit-slider-thumb,
.control-slider::-webkit-slider-thumb,
.instructions-panel .control-slider::-webkit-slider-thumb,
input[type="range"]::-webkit-slider-thumb {
    background: #3b82f6 !important;
}

.slider-control input[type="range"]::-moz-range-thumb,
.control-slider::-moz-range-thumb,
.instructions-panel .control-slider::-moz-range-thumb,
input[type="range"]::-moz-range-thumb {
    background: #3b82f6 !important;
}