/* Protein representation controls styling */

.representation-controls {
    margin: 15px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.representation-controls h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-primary, #2c3e50);
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.representation-controls h3::before {
    content: "🔬";
    font-size: 1.2em;
}

/* Main representation selector */
#representation-select {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    margin-bottom: 15px;
    transition: border-color 0.3s;
}

#representation-select:hover {
    border-color: var(--primary-color, #667eea);
}

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

/* Advanced options container */
.representation-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

/* Individual option groups */
.option-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    min-width: 120px;
}

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

/* Color scheme selector */
#color-scheme {
    flex: 1;
    padding: 6px 10px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    min-width: 150px;
}

#color-scheme:hover {
    border-color: var(--primary-color, #667eea);
}

/* Opacity slider */
.opacity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.opacity-control label {
    min-width: 60px;
    font-size: 14px;
    color: #555;
}

#opacity-slider {
    flex: 1;
    height: 6px;
    background: #dee2e6;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#opacity-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color, #667eea);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#opacity-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color, #667eea);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#opacity-value {
    min-width: 35px;
    text-align: right;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Disabled state for incompatible options */
.option-group.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.option-group.disabled label {
    cursor: not-allowed;
}

/* Tooltip for disabled options */
.option-tooltip {
    position: relative;
    display: inline-block;
}

.option-tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 5px 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.option-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Representation info text */
.representation-info {
    margin-top: 10px;
    padding: 8px;
    background-color: #fff;
    border-left: 3px solid var(--primary-color, #667eea);
    font-size: 13px;
    color: var(--text-secondary, #6c757d);
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .representation-controls {
        padding: 12px;
    }
    
    .option-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .option-group label {
        min-width: auto;
    }
    
    #color-scheme {
        width: 100%;
    }
}

/* Loading indicator */
.representation-loading {
    display: none;
    text-align: center;
    padding: 10px;
    color: #2196F3;
    font-size: 14px;
}

.representation-loading.active {
    display: block;
}

.representation-loading::after {
    content: " ";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 5px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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