/* UI components - Legend, panels, toggles, search, focus mode */

/* Legend */
.legend {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    font-size: 12px;
}

.legend h3 {
    font-size: 11px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.legend-section { margin-bottom: 12px; }
.legend-section:last-child { margin-bottom: 0; }

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.legend-line {
    width: 24px;
    height: 3px;
    border-radius: 2px;
}

.legend-line.monitoring {
    background: repeating-linear-gradient(90deg, #f44336 0px, #f44336 5px, transparent 5px, transparent 10px);
}

.legend-line.backup { background: #ff9800; }

.legend-line.ci-cd {
    background: repeating-linear-gradient(90deg, #9c27b0 0px, #9c27b0 8px, transparent 8px, transparent 12px);
}

.legend-line.vpn { background: #4caf50; }

.legend-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid;
}

.legend-box.iv { background: #e8f5e9; border-color: #2e7d32; }
.legend-box.hetzner { background: #e3f2fd; border-color: #1565c0; }

/* Info panel */
.info-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 280px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    display: none;
}

.info-panel.visible { display: block; }

.info-panel-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-panel-title { font-size: 16px; font-weight: 600; }

.info-panel-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}

.info-panel-content {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
}

.info-row { margin-bottom: 8px; }
.info-label { font-size: 11px; color: #666; text-transform: uppercase; }
.info-value { font-size: 13px; color: #333; }

.info-connections {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.info-connection {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
}

.info-connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.info-connection-dot.monitoring { background: #f44336; }
.info-connection-dot.backup { background: #ff9800; }
.info-connection-dot.ci-cd { background: #9c27b0; }
.info-connection-dot.vpn { background: #4caf50; }

/* Filter toggles */
.filter-toggles {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    border-radius: 12px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.filter-btn.active {
    background: rgba(255,255,255,0.2);
    color: white;
    border-color: rgba(255,255,255,0.5);
}

.filter-btn:hover { background: rgba(255,255,255,0.25); }

.filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Export button */
.export-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    background: #4caf50;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.export-btn:hover { background: #43a047; }
.export-btn:disabled { background: #9e9e9e; cursor: wait; }

/* Search button */
.search-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover { background: rgba(255,255,255,0.2); }

/* Search panel */
.search-panel {
    position: fixed;
    top: 70px;
    right: 320px;
    width: 280px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 100;
    display: none;
    max-height: calc(100vh - 100px);
    overflow: hidden;
}

.search-panel.visible {
    display: flex;
    flex-direction: column;
}

.search-panel-header {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-panel-title { font-size: 14px; font-weight: 600; flex: 1; }

#search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

#search-input:focus { outline: none; border-color: #1a237e; }

.search-panel-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
}

.search-results { overflow-y: auto; max-height: 400px; }

.search-results-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 12px;
}

.search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.search-result-item:hover { background: #f5f7fa; }
.search-result-item:last-child { border-bottom: none; }
.search-result-name { font-weight: 600; font-size: 13px; color: #1a237e; }
.search-result-purpose { font-size: 11px; color: #666; margin-top: 2px; }
.search-result-region { font-size: 10px; color: #999; margin-top: 2px; }

/* Center button */
.center-btn {
    width: 100%;
    padding: 8px;
    margin-top: 12px;
    background: #1a237e;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.center-btn:hover { background: #283593; }

/* Focus mode button */
.focus-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.focus-btn:hover:not(:disabled) { background: rgba(255,255,255,0.2); }
.focus-btn.active { background: #ff9800; border-color: #ff9800; }
.focus-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Focus mode indicator */
.focus-mode-indicator {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff9800;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.focus-mode-indicator.visible { display: block; }

/* Container info in info panel */
.container-info-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.container-info-title {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.container-dep-list { font-size: 10px; color: #666; }
.container-dep-list li { margin-bottom: 4px; }
.container-dep-list .dep-type { font-size: 9px; color: #999; margin-left: 4px; }

/* Zoom indicator */
.zoom-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 24px;
    font-weight: 600;
    padding: 16px 28px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-out;
    z-index: 1000;
}

.zoom-indicator.visible {
    opacity: 1;
}
