/* Frise Theme Selector Component Styles */

.frise-theme-selector-container {
    position: relative;
    width: 100%;
}

.frise-theme-search-field {
    position: relative;
}

.frise-theme-search-field .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.frise-theme-search-field .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.frise-theme-selected-list {
    margin-bottom: 12px;
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    background: #f8f9fa;
}

.frise-selected-empty {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
    padding: 8px;
}

.frise-selected-theme {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 16px;
    padding: 4px 8px;
    margin: 2px;
    font-size: 12px;
    gap: 6px;
}

.frise-selected-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.frise-selected-name {
    color: #495057;
    font-weight: 500;
}

.frise-selected-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    font-size: 10px;
}

.frise-selected-remove:hover {
    background-color: rgba(220, 53, 69, 0.1);
}

.frise-theme-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    max-height: min(400px, calc(30vh));
    overflow-y: auto;
    z-index: 99999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 350px;
}

/* Positionnement automatique vers le haut si pas assez de place en bas */
.frise-theme-results.position-up {
    top: auto;
    bottom: 100%;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.frise-theme-item {
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.frise-theme-item:last-child {
    border-bottom: none;
}

.frise-theme-item:hover .frise-theme-item-content {
    background-color: rgba(0, 123, 255, 0.05);
}

.frise-theme-item.selected .frise-theme-item-content {
    background-color: rgba(0, 123, 255, 0.1);
    border-left: 3px solid #007bff;
}

.frise-theme-item-content {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
    position: relative;
}

.frise-theme-checkbox {
    flex-shrink: 0;
    color: #007bff;
    font-size: 14px;
}

.frise-theme-level-0 {
    background-color: #f8f9fa;
}

.frise-theme-level-1 {
    background-color: #fff;
}

.frise-theme-level-2 {
    background-color: #fff;
}

.frise-theme-level-3 {
    background-color: #fff;
}

.frise-theme-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.frise-theme-info {
    flex: 1;
    min-width: 0;
}

.frise-theme-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    font-size: 13px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
}

.frise-theme-hierarchy-indent {
    font-family: 'Courier New', monospace;
    color: #888;
    margin-right: 4px;
    flex-shrink: 0;
    font-size: 11px;
}

.frise-theme-name-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.frise-theme-description {
    font-size: 11px;
    color: #666;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.frise-theme-level-badge {
    font-size: 9px;
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    padding: 2px 5px;
    border-radius: 8px;
    margin-left: auto;
    flex-shrink: 0;
    font-weight: 500;
}

.frise-theme-search-no-results,
.frise-theme-search-error {
    padding: 16px;
    text-align: center;
    color: #666;
    font-style: italic;
    font-size: 13px;
}

.frise-theme-search-error {
    color: #dc3545;
}

/* Actions */
.frise-theme-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.frise-theme-clear-all {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.frise-theme-clear-all:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .frise-theme-results {
        max-height: 300px;
        min-width: 300px;
    }
    
    .frise-theme-item-content {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .frise-theme-selected-list {
        max-height: 80px;
    }
}