/* API Search Styles */

.api-search-form {
    margin-bottom: 1.5rem;
    position: relative;
}

.api-search-form .input-group {
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.api-search-form .input-group-field {
    height: 3rem;
    font-size: 1rem;
    border: 2px solid #e0e0e0;
    border-right: none;
    padding: 0 1rem;
    transition: border-color 0.3s ease;
}

.api-search-form .input-group-field:focus {
    border-color: #2196f3;
    outline: none;
    box-shadow: none;
}

.api-search-form .input-group-button {
    border: none;
}

.api-search-form .button {
    height: 3rem;
    padding: 0 2rem;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0.5px;
}

.api-search-form .button:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8e 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.api-search-form .button:active {
    transform: translateY(0);
}

.api-search-form .button i {
    margin-right: 0.5rem;
}

/* Autocomplete Dropdown Styles */

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: -4px;
}

.autocomplete-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: #f5f5f5;
}

.autocomplete-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a0dab;
    margin-bottom: 4px;
    line-height: 1.3;
}

.autocomplete-snippet {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fallback Search Styles (legacy) */

.fallback-search-form {
    margin-bottom: 1.5rem;
}

.fallback-search-form .input-group {
    margin-bottom: 0;
}

.fallback-search-form .input-group-field {
    height: 2.5rem;
    font-size: 1rem;
    border: 1px solid #cacaca;
}

.fallback-search-form .button {
    height: 2.5rem;
    padding: 0 1.5rem;
    margin: 0;
}

/* Search Results List */
.search-results-list {
    margin-top: 1rem;
}

.search-stats {
    color: #8a8a8a;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e6e6e6;
}

.search-result-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e6e6e6;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item h5 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.search-result-item h5 a {
    color: #1a0dab;
    text-decoration: none;
}

.search-result-item h5 a:hover {
    text-decoration: underline;
}

.search-result-snippet {
    color: #545454;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.search-result-url {
    color: #006621;
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* Fallback container */
#fallback-search-container {
    width: 100%;
}

/* Loading spinner animation */
.fa-spinner.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notification styles */
.callout.warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.callout.alert {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Search Modal Size Override */
#search_modal {
    max-width: 800px;
    min-height: 500px;
    max-height: 90vh;
    overflow: visible;
}

#search_modal .search-container {
    min-height: 400px;
}

/* Ensure autocomplete doesn't cause modal scrolling */
@media screen and (min-width: 640px) {
    #search_modal {
        max-width: 900px;
        min-height: 600px;
    }
}

@media screen and (min-width: 1024px) {
    #search_modal {
        max-width: 1000px;
        min-height: 650px;
    }
}
