/**
 * Shared Search Form Styles
 * Common styles for search form components across different contexts
 *
 * @package  WP_Company_Manager
 * @category Styles
 * @author   WebFX <support@webfx.com>
 * @license  GPL-2.0+ https://www.gnu.org/licenses/gpl-2.0.txt
 * @link     https://www.webfx.com
 */

/* Search Form Container */
.wpcm-search-form-container {
    margin-bottom: 20px;
}

/* Header Section */
.wpcm-search-form-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.wpcm-search-form-header h2 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 1.8rem;
}

.wpcm-search-form-header p {
    color: #6c757d;
    margin: 0;
    font-size: 1rem;
}

/* Form Styling */
.wpcm-search-form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
    align-items: center;
}

.wpcm-search-input-group {
    width: 100%;
}

.wpcm-search-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}
.wpcm-search-input-wrapper input[type="text"] {
    background: #fff;
}

.wpcm-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.wpcm-search-input:focus {
    border-color: #1976d2;
}

.wpcm-search-button {
    background: #22366f;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.wpcm-search-button:hover {
    background: #1565c0;
}

.wpcm-search-button:active {
    background: #0d47a1;
}

/* Error Display */
.wpcm-search-error {
    color: #d32f2f;
    font-size: 0.9rem;
    margin-top: 8px;
    text-align: center;
}

/* Context-Specific Styles */

/* Compact Form */
.wpcm-search-form-container--compact .wpcm-search-form-header {
    padding: 15px;
}

.wpcm-search-form-container--compact .wpcm-search-form-header h2 {
    font-size: 1.4rem;
}

.wpcm-search-form-container--compact .wpcm-search-input,
.wpcm-search-form-container--compact .wpcm-search-button {
    padding: 10px 15px;
    font-size: 0.9rem;
}

/* Inline Form */
.wpcm-search-form-container--inline .wpcm-search-form {
    max-width: none;
    margin: 0;
}

.wpcm-search-form-container--inline .wpcm-search-form-header {
    text-align: left;
    background: none;
    padding: 0;
    margin-bottom: 15px;
}

/* Full Width Form */
.wpcm-search-form-container--full-width .wpcm-search-form {
    max-width: none;
}

.wpcm-search-form-container--full-width .wpcm-search-input {
    min-width: 0;
}

/* Zipcode Style (Legacy Support) */
.wpcm-search-form-container--zipcode .wpcm-search-input {
    max-width: 150px;
}

.wpcm-search-form-container--zipcode .wpcm-search-button {
    background: #28a745;
}

.wpcm-search-form-container--zipcode .wpcm-search-button:hover {
    background: #218838;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wpcm-search-form {
        flex-direction: column;
        gap: 15px;
    }

    .wpcm-search-input-wrapper {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .wpcm-search-input {
        width: 100%;
    }

    .wpcm-search-button {
        width: 100%;
        padding: 14px 20px;
    }

    .wpcm-search-form-header h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .wpcm-search-form-header {
        padding: 15px;
    }

    .wpcm-search-form-header h2 {
        font-size: 1.4rem;
    }

    .wpcm-search-input,
    .wpcm-search-button {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* Loading State */
.wpcm-search-button.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.wpcm-search-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid rgba(255,255,255,0.8);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus States for Accessibility */
.wpcm-search-input:focus,
.wpcm-search-button:focus {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wpcm-search-input {
        border-width: 3px;
    }

    .wpcm-search-button {
        border: 2px solid currentColor;
    }
}

/* Get Directions button styling */
.wpcm-directions-btn,
.btn-directions {
    display: inline-block;
    padding: 8px 16px;
    background-color: #4285f4;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.wpcm-directions-btn:hover,
.btn-directions:hover {
    background-color: #3367d6;
    color: white !important;
    text-decoration: none;
}

.wpcm-map-info-actions {
    margin-top: 10px;
}

.wpcm-map-info-actions a {
    margin-right: 10px;
}