/* Elegant Languages Selector */
.elegant-languages-selector {
    position: relative;
    width: 100%;
}

.selected-languages-container {
    min-height: 48px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    padding: 8px 12px;
    background: white;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    cursor: text;
    transition: border-color 0.3s ease;
}

.selected-languages-container:focus-within {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.selected-languages-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.language-tag {
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: tagAppear 0.3s ease;
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.2);
}

.language-tag:hover {
    background: linear-gradient(135deg, #b8941f, #9d7a1a);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(212, 175, 55, 0.3);
}

.language-tag-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.language-tag-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

.languages-search-input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #2c3e50;
    flex: 1;
    min-width: 120px;
    padding: 4px 0;
}

.languages-search-input::placeholder {
    color: #7f8c8d;
}

.languages-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e1e8ed;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.languages-suggestions.show {
    display: block;
    animation: suggestionsAppear 0.2s ease;
}

.language-suggestion {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f2f6;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-suggestion:hover {
    background: #f8f9fa;
}

.language-suggestion:last-child {
    border-bottom: none;
}

.language-suggestion.highlighted {
    background: #e8f4f8;
}

.language-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    background: #e1e8ed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

.popular-languages {
    padding: 12px 16px;
    border-bottom: 1px solid #e1e8ed;
    background: #f8f9fa;
}

.popular-languages-title {
    font-size: 12px;
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popular-languages-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.popular-language-chip {
    background: white;
    border: 1px solid #e1e8ed;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.popular-language-chip:hover {
    border-color: #d4af37;
    background: #fefcf7;
}

@keyframes tagAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes suggestionsAppear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .selected-languages-container {
        min-height: 44px;
        padding: 6px 10px;
    }
    
    .language-tag {
        font-size: 13px;
        padding: 3px 10px;
    }
    
    .languages-search-input {
        font-size: 14px;
        min-width: 100px;
    }
    
    .languages-suggestions {
        max-height: 150px;
    }
    
    .language-suggestion {
        padding: 10px 12px;
    }
}

/* Empty state */
.selected-languages-container.empty .languages-search-input {
    width: 100%;
}

/* Focus states */
.selected-languages-container:focus-within .languages-search-input::placeholder {
    color: #bdc3c7;
}

/* Validation states */
.elegant-languages-selector.error .selected-languages-container {
    border-color: #e74c3c;
}

.elegant-languages-selector.error .selected-languages-container:focus-within {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.elegant-languages-selector.valid .selected-languages-container {
    border-color: #27ae60;
}

/* Scrollbar styling for suggestions */
.languages-suggestions::-webkit-scrollbar {
    width: 6px;
}

.languages-suggestions::-webkit-scrollbar-track {
    background: #f1f2f6;
}

.languages-suggestions::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 3px;
}

.languages-suggestions::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}
