/* Base wrapper */
.search-form-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.search-form {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}

/* Input wrapper - Clean & Simple */
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-input-wrapper:hover {
    border-color: #007cba;
}

.search-input-wrapper:focus-within {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Input field - Clean styling without icon */
.search-field {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 400;
    background: transparent;
    color: #333;
    line-height: 1.5;
    min-width: 0;
}

.search-field::placeholder {
    color: #6c757d;
    font-weight: 400;
}

.search-field:focus::placeholder {
    color: #adb5bd;
}

/* Submit button - Simple & Clean */
.search-submit {
    background: #007cba;
    border: none;
    padding: 0;
    margin: 0;
    height: 100%;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    border-radius: 0;
}

.search-submit:hover {
    background: #0056b3;
}

.search-submit:active {
    background: #004085;
}

.search-submit:focus-visible {
    outline: 2px solid #0056b3;
    outline-offset: -2px;
}

/* Loading spinner */
.search-loading {
    position: absolute;
    top: 50%;
    right: 140px;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Search suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.suggestions-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.suggestions-list li {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f8f9fa;
}

.suggestions-list li:last-child {
    border-bottom: none;
}

.suggestions-list li:hover,
.suggestions-list li.active {
    background-color: #f8f9fa;
}

/* Hidden labels for accessibility */
.search-label {
    position: absolute;
    left: -9999px;
}

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    padding: 0 !important;
    border: 0 !important;
    height: 1px !important;
    width: 1px !important;
    overflow: hidden;
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Loading state */
.search-form.loading .search-submit {
    pointer-events: none;
    opacity: 0.7;
}

/* Error state */
.search-input-wrapper.error {
    border-color: #dc3545;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    75% {
        transform: translateX(3px);
    }
}

/* Success state */
.search-input-wrapper.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Responsive Design - No icon version */
@media (min-width: 768px) {
    .search-form-wrapper {
        max-width: 600px;
    }

    .search-field {
        font-size: 16px;
        padding: 14px 24px;
    }

    .search-submit {
        min-width: 140px;
        font-size: 14px;
    }
}

@media (max-width: 767px) {
    .search-form-wrapper {
        max-width: 100%;
        margin: 0 16px;
    }

    .search-field {
        font-size: 16px;
        padding: 12px 20px;
    }

    .search-submit {
        min-width: 100px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .search-form-wrapper {
        margin: 0 12px;
    }

    .search-field {
        padding: 10px 16px;
        font-size: 16px;
    }

    .search-submit {
        min-width: 80px;
        font-size: 11px;
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .search-input-wrapper {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .search-field {
        color: #e2e8f0;
    }

    .search-field::placeholder {
        color: #a0aec0;
    }

    .search-suggestions {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .suggestions-list li {
        border-bottom-color: #4a5568;
    }

    .suggestions-list li:hover,
    .suggestions-list li.active {
        background-color: #4a5568;
    }
}

/* Manual dark theme class */
.search-form-wrapper.dark-theme .search-input-wrapper {
    background: #2d3748;
    border-color: #4a5568;
}

.dark-theme .search-field {
    color: #e2e8f0;
}

.dark-theme .search-field::placeholder {
    color: #a0aec0;
}

.dark-theme .search-suggestions {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .search-input-wrapper {
        border-width: 3px;
    }

    .search-submit {
        font-weight: 600;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .search-input-wrapper,
    .search-submit {
        transition: none;
    }

    .search-spinner {
        animation: none;
    }
}

/* Print styles */
@media print {
    .search-form-wrapper {
        display: none;
    }
}

/* Custom scrollbar for suggestions */
.search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Utility classes */
.search-form-wrapper.large {
    max-width: 700px;
}

.search-form-wrapper.small {
    max-width: 350px;
}

.search-form-wrapper.full-width {
    max-width: 100%;
}

/* Compact version */
.search-form-wrapper.compact .search-field {
    padding: 8px 16px;
    font-size: 14px;
}

.search-form-wrapper.compact .search-submit {
    min-width: 80px;
    font-size: 12px;
}

/* Minimal version */
.search-form-wrapper.minimal .search-input-wrapper {
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: none;
}

.search-form-wrapper.minimal .search-input-wrapper:hover {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.search-form-wrapper.minimal .search-submit {
    background: #007cba;
    border-radius: 0;
}

.search-form-wrapper.minimal .search-submit:hover {
    background: #0056b3;
}