/* Theme Search Component Styles */

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

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

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

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

.theme-search-current-selection {
    margin-top: 8px;
}

.theme-search-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
}

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

.theme-search-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.theme-search-remove:hover {
    background-color: #f5c6cb;
}

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

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

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

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

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

.theme-level-0 {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
}

.theme-level-1 {
    background-color: #fff;
    border-left: 4px solid #28a745;
}

.theme-level-2 {
    background-color: #fff;
    border-left: 4px solid #ffc107;
}

.theme-level-3 {
    background-color: #fff;
    border-left: 4px solid #dc3545;
}

.theme-level-4,
.theme-level-5,
.theme-level-6 {
    background-color: #fff;
    border-left: 4px solid #6c757d;
}

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

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

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

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

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

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

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

.theme-search-path {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-top: 2px;
    opacity: 0.8;
}

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

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

/* Integration with existing form styles */
.medium-compact-row .theme-search-container {
    flex: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .theme-search-results {
        max-height: 200px;
    }
    
    .theme-search-item-content {
        padding: 10px;
    }
}