/* Dynamic Layer Selector Styles */

.dynamic-layer-selector {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    color: var(--text-primary);
}

.layer-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.layer-selector-header h4 {
    margin: 0;
    color: var(--text-primary);
}

/* Selected Layers Container */
.selected-layers-container {
    min-height: 100px;
}

.no-layers {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.no-layers i {
    opacity: 0.5;
}

/* Selected Layer Items */
.selected-layer-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.selected-layer-item:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.layer-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.layer-info {
    flex: 1;
    min-width: 0;
}

.layer-name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.layer-type {
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

/* Weight Control */
.layer-weight-control {
    min-width: 200px;
}

.weight-slider-container {
    position: relative;
}

.weight-slider {
    width: 100%;
    margin: 0.5rem 0;
}

.weight-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.weight-value {
    font-weight: 600;
    color: #007bff;
}

.layer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Modal Styles */
.layer-categories {
    max-height: 400px;
    overflow-y: auto;
}

.layer-category {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.layer-category:last-child {
    border-bottom: none;
}

.category-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.layer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.layer-option {
    cursor: pointer;
    transition: all 0.2s ease;
}

.layer-option:hover:not(.disabled) {
    transform: translateY(-2px);
}

.layer-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.layer-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.layer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.layer-card .layer-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.layer-card .layer-type {
    font-size: 0.75rem;
    white-space: nowrap;
}

.layer-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    flex: 1;
}

.trigger-words {
    font-size: 0.75rem;
    font-style: italic;
    margin-top: 0.5rem;
}

.layer-actions {
    margin-top: auto;
    padding-top: 0.75rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .layer-control {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .layer-weight-control {
        min-width: auto;
    }
    
    .layer-grid {
        grid-template-columns: 1fr;
    }
    
    .layer-selector-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
}

/* Animation for adding/removing layers */
.selected-layer-item {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Weight slider custom styling */
.weight-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
}

.weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.weight-slider::-webkit-slider-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.weight-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.weight-slider::-moz-range-thumb:hover {
    background: #0056b3;
    transform: scale(1.1);
}

/* Loading state */
.layer-selector-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.layer-selector-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
