/**
 * NAICS Autocomplete Styles
 */

.naics-autocomplete {
    position: relative;
    font-size: 12px !important;
    line-height: 1.3 !important;
}

/* More specific selectors to override Bootstrap and other CSS */
input.naics-autocomplete.form-control {
    font-size: 12px !important;
    line-height: 1.3 !important;
    padding: 8px 12px !important;
}

.naics-autocomplete-container input.form-control {
    font-size: 12px !important;
    line-height: 1.3 !important;
    padding: 8px 12px !important;
}

.naics-autocomplete-container .naics-autocomplete {
    font-size: 12px !important;
    line-height: 1.3 !important;
    padding: 8px 12px !important;
}

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

.naics-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
    font-size: 12px;
    line-height: 1.3;
}

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

.naics-item:hover {
    background-color: #f8f9fa;
}

.naics-item strong {
    color: #007bff;
    font-weight: 600;
}

.naics-no-results {
    padding: 12px;
    color: #6c757d;
    font-style: italic;
    text-align: center;
    font-size: 12px;
}

/* Ensure the parent container has relative positioning */
.naics-autocomplete-container {
    position: relative;
}

/* Style for the input when focused */
.naics-autocomplete:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Loading state */
.naics-autocomplete.loading {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="8" cy="8" r="7" fill="none" stroke="%23ccc" stroke-width="2"/><path d="M15 8a7 7 0 0 1-7 7" fill="none" stroke="%23007bff" stroke-width="2"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .naics-dropdown {
        max-height: 150px;
    }
    
    .naics-item {
        padding: 8px 10px;
        font-size: 14px;
    }
}