/* Legislation Mapper Visualization Styles */

.visualization-container {
    width: 100%;
    height: 100vh;
    position: relative;
    background: #f8f9fa;
    overflow: hidden;
}

.visualization-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 250px;
}

.control-group {
    margin-bottom: 15px;
    position: relative;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

.control-group input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.control-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.3s;
}

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

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

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

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #bd2130;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Range slider styling */
input[type="range"] {
    -webkit-appearance: none;
    height: 5px;
    border-radius: 5px;
    background: #d3d3d3;
    outline: none;
}

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

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
}

/* Statistics panel */
.stats-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 200px;
}

.stats-panel h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

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

.stat-label {
    color: #666;
}

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

/* Legend */
.legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.legend h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    border: 2px solid #fff;
}

.legend-line {
    width: 20px;
    height: 3px;
    margin-right: 8px;
}

/* Loading spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tooltip styling */
.legislation-tooltip {
    font-family: Arial, sans-serif;
    line-height: 1.4;
    z-index: 2000;
}

/* SVG styles */
.legislation-graph svg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
}

.legislation-graph .link {
    transition: stroke-width 0.3s, stroke-opacity 0.3s;
}

.legislation-graph .link:hover {
    stroke-width: 4px !important;
    stroke-opacity: 1 !important;
}

.legislation-graph .node {
    transition: r 0.3s, stroke-width 0.3s, filter 0.3s;
    cursor: pointer;
}

.legislation-graph .node:hover {
    r: 16px;
    stroke-width: 3px;
    filter: brightness(1.2) drop-shadow(0 0 8px rgba(0,0,0,0.3));
}

.legislation-graph .label {
    font-family: 'Arial', sans-serif;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9), -1px -1px 2px rgba(255, 255, 255, 0.9), 1px -1px 2px rgba(255, 255, 255, 0.9), -1px 1px 2px rgba(255, 255, 255, 0.9);
}

.legislation-graph .label tspan {
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9), -1px -1px 2px rgba(255, 255, 255, 0.9), 1px -1px 2px rgba(255, 255, 255, 0.9), -1px 1px 2px rgba(255, 255, 255, 0.9);
}

/* Search results */
.search-results {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 9999 !important;
    background: white !important;
    border: 2px solid #007bff !important;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    min-height: 50px;
}

.search-result-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-size: 14px;
    background: white !important;
    transition: background-color 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #e3f2fd !important;
}

.search-result-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.search-result-meta {
    color: #666;
    font-size: 12px;
}

/* Responsive design */
@media (max-width: 768px) {
    .visualization-controls {
        position: relative;
        width: 100%;
        margin-bottom: 20px;
    }
    
    .stats-panel {
        position: relative;
        width: 100%;
        margin-bottom: 20px;
        right: auto;
        top: auto;
    }
    
    .legend {
        position: relative;
        width: 100%;
        bottom: auto;
        left: auto;
    }
    
    .visualization-container {
        height: 60vh;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .visualization-container {
        background: #1a1a1a;
    }
    
    .visualization-controls,
    .stats-panel,
    .legend,
    .search-results {
        background: rgba(30, 30, 30, 0.95);
        color: #f8f9fa;
    }
    
    .control-group label,
    .stats-panel h4,
    .legend h4,
    .stat-value,
    .search-result-title {
        color: #f8f9fa;
    }
    
    .stat-label,
    .search-result-meta {
        color: #adb5bd;
    }
    
    .control-group input[type="text"],
    .control-group select {
        background: #343a40;
        color: #f8f9fa;
        border-color: #495057;
    }
    
    .search-result-item:hover {
        background-color: #343a40;
    }
}