/* Sophisticated Occupation Filter and Language Selector Styles */

/* Occupation Filter Styles */
.sophisticated-occupation-filter {
    position: relative;
    width: 100%;
}

.occupation-search {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: #2d3748;
    transition: all 0.3s ease;
    cursor: text;
}

.occupation-search:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    transform: translateY(-1px);
}

.occupation-search.selected {
    border-color: #38a169;
    background-color: #f0fff4;
}

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

.occupation-category {
    border-bottom: 1px solid #f1f5f9;
}

.occupation-category:last-child {
    border-bottom: none;
}

.category-header {
    padding: 12px 16px;
    background: #f8fafc;
    font-family: 'Cormorant Garamond', serif;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.occupations-list {
    max-height: 200px;
    overflow-y: auto;
}

.occupation-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #2d3748;
    border-bottom: 1px solid #f7fafc;
}

.occupation-item:hover {
    background: #f7fafc;
    color: #d4af37;
    padding-left: 20px;
}

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

/* Language Selector Styles */
.sophisticated-language-selector {
    position: relative;
    width: 100%;
}

.selected-languages {
    min-height: 50px;
    padding: 8px;
    border: 2px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    background: white;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    transition: all 0.3s ease;
}

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

.languages-placeholder {
    color: #a0aec0;
    font-style: italic;
    font-size: 14px;
}

.language-tag {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: white;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.language-tag span {
    margin-right: 6px;
}

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

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.language-search {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0;
    background: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    color: #2d3748;
    transition: all 0.3s ease;
}

.language-search:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    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);
}

.language-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #2d3748;
    border-bottom: 1px solid #f7fafc;
}

.language-item:hover {
    background: #f7fafc;
    color: #d4af37;
    padding-left: 20px;
}

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

/* Enhanced Form Integration */
.sophisticated-field .sophisticated-occupation-filter,
.sophisticated-field .sophisticated-language-selector {
    margin-top: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .occupation-dropdown,
    .language-dropdown {
        max-height: 250px;
    }
    
    .selected-languages {
        min-height: 60px;
        padding: 10px;
    }
    
    .language-tag {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .occupation-item,
    .language-item {
        padding: 12px 16px;
        font-size: 15px;
    }
}

/* Loading States */
.occupation-search.loading,
.language-search.loading {
    background-image: url("data:image/svg+xml,%3csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3e%3cg fill='none' fill-rule='evenodd'%3e%3cg fill='%23d4af37' fill-rule='nonzero'%3e%3ccircle cx='10' cy='10' r='2'%3e%3canimate attributeName='r' begin='0s' dur='1.8s' values='2;10;2' calcMode='spline' keyTimes='0;0.2;1' keySplines='0.165,0.84,0.44,1;0.3,0.61,0.355,1' repeatCount='indefinite'/%3e%3canimate attributeName='stroke-opacity' begin='0s' dur='1.8s' values='1;0;0' calcMode='spline' keyTimes='0;0.2;1' keySplines='0.3,0.61,0.355,1;0.165,0.84,0.44,1' repeatCount='indefinite'/%3e%3c/circle%3e%3c/g%3e%3c/g%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

/* Validation States */
.sophisticated-field.error .occupation-search,
.sophisticated-field.error .selected-languages,
.sophisticated-field.error .language-search {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.sophisticated-field.success .occupation-search,
.sophisticated-field.success .selected-languages,
.sophisticated-field.success .language-search {
    border-color: #38a169;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}

/* Accessibility Improvements */
.occupation-item:focus,
.language-item:focus {
    outline: 2px solid #d4af37;
    outline-offset: -2px;
    background: #f7fafc;
}

.remove-language:focus {
    outline: 2px solid white;
    outline-offset: 1px;
}

/* Dark Mode Support (if needed) */
@media (prefers-color-scheme: dark) {
    .occupation-dropdown,
    .language-dropdown,
    .selected-languages,
    .occupation-search,
    .language-search {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .category-header {
        background: #1a202c;
        color: #a0aec0;
    }
    
    .occupation-item:hover,
    .language-item:hover {
        background: #4a5568;
        color: #d4af37;
    }
    
    .languages-placeholder {
        color: #718096;
    }
}
