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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a2e 50%, #16213e 100%);
    color: #e4e4e7;
    min-height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 10px;
    gap: 10px;
}

header {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 2px;
    color: #8b5cf6;
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.subtitle {
    font-size: 14px;
    color: #71717a;
    margin-top: 5px;
}

.main-content {
    display: flex;
    flex: 1;
    gap: 10px;
    overflow: hidden;
}

.control-panel {
    width: 280px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-section h3 {
    font-size: 14px;
    color: #a1a1aa;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.strategy-btn {
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e4e4e7;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.strategy-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.5);
}

.strategy-btn.active {
    background: rgba(139, 92, 246, 0.3);
    border-color: #8b5cf6;
    color: #c4b5fd;
}

select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #e4e4e7;
    cursor: pointer;
    font-size: 13px;
}

select:hover {
    border-color: rgba(139, 92, 246, 0.5);
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.control-row label {
    font-size: 13px;
    color: #a1a1aa;
    min-width: 60px;
}

input[type="range"] {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #8b5cf6;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.button-row {
    display: flex;
    gap: 8px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #e4e4e7;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.action-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.primary {
    background: rgba(139, 92, 246, 0.3);
    border-color: #8b5cf6;
}

.action-btn.primary:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.4);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #a1a1aa;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.canvas-container {
    flex: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

#tree-canvas {
    width: 100%;
    height: 100%;
    cursor: grab;
}

#tree-canvas:active {
    cursor: grabbing;
}

.canvas-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
}

.stats-panel {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 200px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

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

.stat-label {
    color: #a1a1aa;
}

.stat-value {
    color: #8b5cf6;
    font-weight: 600;
}

.legend-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
}

.legend-panel h3 {
    font-size: 14px;
    color: #a1a1aa;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legend-items {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #a1a1aa;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.legend-color.unexplored {
    background: rgba(113, 113, 122, 0.3);
    border: 2px solid #71717a;
}

.legend-color.exploring {
    background: rgba(250, 204, 21, 0.4);
    border: 2px solid #facc15;
    box-shadow: 0 0 15px rgba(250, 204, 21, 0.6);
}

.legend-color.explored {
    background: rgba(59, 130, 246, 0.4);
    border: 2px solid #3b82f6;
}

.legend-color.pruned {
    background: rgba(239, 68, 68, 0.3);
    border: 2px solid #ef4444;
}

.legend-color.optimal {
    background: rgba(34, 197, 94, 0.5);
    border: 2px solid #22c55e;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.8);
}

.legend-color.goal {
    background: rgba(234, 179, 8, 0.5);
    border: 2px solid #eab308;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.8);
}

.info-panel {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px;
    min-height: 100px;
}

.info-panel h3 {
    font-size: 14px;
    color: #a1a1aa;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-text {
    font-size: 13px;
    color: #a1a1aa;
    line-height: 1.6;
}

.constraint-info {
    background: rgba(139, 92, 246, 0.1);
    border-left: 3px solid #8b5cf6;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
}

.constraint-label {
    font-size: 11px;
    color: #8b5cf6;
    margin-top: 5px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}
