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

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

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: #a0a0a0;
    font-size: 1.1rem;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    margin-bottom: 30px;
}

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

#topologyCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

#topologyCanvas:active {
    cursor: grabbing;
}

.canvas-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.property-display {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.property-label {
    font-size: 0.85rem;
    color: #a0a0a0;
    font-weight: 500;
}

.property-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    min-width: 60px;
    text-align: right;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-height: 700px;
    overflow-y: auto;
    padding-right: 10px;
}

.controls-panel::-webkit-scrollbar {
    width: 8px;
}

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

.controls-panel::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.control-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.control-section h3 {
    font-size: 1rem;
    color: #667eea;
    margin-bottom: 12px;
    font-weight: 600;
}

.control-select {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-select:hover {
    border-color: rgba(102, 126, 234, 0.5);
}

.control-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mode-buttons,
.operation-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-btn,
.operation-btn,
.toggle-btn {
    flex: 1;
    min-width: 90px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover,
.operation-btn:hover,
.toggle-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
    transform: translateY(-2px);
}

.mode-btn.active,
.toggle-btn.active {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    color: #fff;
}

.slider-container {
    margin-bottom: 15px;
}

.slider-label {
    display: block;
    font-size: 0.85rem;
    color: #a0a0a0;
    margin-bottom: 8px;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.slider-container input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.info-section {
    background: rgba(102, 126, 234, 0.05);
}

.info-box {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #b0b0b0;
}

.info-box p {
    margin-bottom: 8px;
}

.info-box strong {
    color: #667eea;
}

.instructions {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    padding: 8px 0;
    color: #b0b0b0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.instructions li:last-child {
    border-bottom: none;
}

.instructions strong {
    color: #e0e0e0;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .controls-panel {
        max-height: none;
    }

    .canvas-container {
        height: 500px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .canvas-container {
        height: 400px;
    }

    .mode-buttons,
    .operation-buttons {
        flex-direction: column;
    }

    .mode-btn,
    .operation-btn,
    .toggle-btn {
        min-width: 100%;
    }
}

/* Animation for property value changes */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.property-value.updating {
    animation: pulse 0.5s ease-in-out;
}
