/* Network Visualizer Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f0f0f0;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Canvas Area */
.canvas-container {
    flex: 1;
    position: relative;
    background-color: #ffffff;
    overflow: hidden;
}

#networkCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* Tooltip */
.tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-line;
    pointer-events: none;
    z-index: 1000;
    display: none;
    max-width: 300px;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

/* Control Panel */
.control-panel {
    width: 280px;
    background-color: #ffffff;
    border-left: 1px solid #ddd;
    overflow-y: auto;
    padding: 12px;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
}

.control-panel h2 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 4px;
}

.control-panel h3 {
    font-size: 12px;
    margin-bottom: 6px;
    color: #555;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-section {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.control-section:last-child {
    border-bottom: none;
}

/* Form Controls */
label {
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    color: #555;
    font-weight: 500;
}

label span {
    float: right;
    color: #007bff;
    font-weight: 600;
}

input[type="range"] {
    width: 100%;
    margin-bottom: 8px;
    height: 4px;
    border-radius: 2px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 4px;
    font-weight: normal;
}

label:has(input[type="checkbox"]):hover {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding-left: 4px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 6px 8px;
    margin-bottom: 6px;
    border: 1px solid #ddd;
    background-color: #f8f9fa;
    color: #333;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Info Displays */
#nodeCount,
#edgeCount,
#totalPower,
#cableInfo,
#lengthFilterLabel {
    font-size: 11px;
    color: #555;
    margin-bottom: 4px;
    padding: 4px 8px;
    background-color: #f8f9fa;
    border-radius: 3px;
    border-left: 2px solid #007bff;
}

#totalPower {
    font-weight: 600;
    border-left: 2px solid #28a745;
}

.info-box {
    font-size: 11px;
    color: #555;
    margin-top: 6px;
    padding: 6px 8px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 3px;
    white-space: pre-line;
    line-height: 1.4;
    max-height: 120px;
    overflow-y: auto;
}

/* Zoom Controls */
.control-section:has(#zoomInBtn) {
    display: flex;
    gap: 8px;
}

.control-section:has(#zoomInBtn) .btn {
    flex: 1;
    margin-bottom: 0;
}

/* Scrollbar Styling */
.control-panel::-webkit-scrollbar {
    width: 8px;
}

.control-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.control-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .control-panel {
        width: 100%;
        height: 40vh;
        border-left: none;
        border-top: 1px solid #ddd;
    }

    .canvas-container {
        height: 60vh;
    }
}

/* Loading State */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #007bff;
    font-weight: 500;
}

/* Error State */
.error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #dc3545;
    font-weight: 500;
    text-align: center;
    padding: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Footer */
.footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background-color: #24292e;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 6px;
}

.github-link:hover {
    background-color: #1a1e22;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.github-link svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.ai-note {
    font-size: 10px;
    color: #888;
    margin-top: 6px;
    line-height: 1.3;
    font-style: italic;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.highlight {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}
