/**
 * EasyRx Autocomplete Styles
 * 
 * @package EasyRx_Autocomplete
 * @since 2.0.0
 */

/* Main Container */
.easyrx-autocomplete-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: #C2E7D0; 
    padding: 64px 0px;
    box-sizing: border-box;
    max-width: 100%;
    background-image: url('../images/background_medication.webp');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    height: 280px
}

/* Title Styling */
.easyrx-autocomplete-container > .easyrx-autocomplete-title {
    font-size: 64px;
    font-style: normal;
    font-weight: 700;
    line-height: 72px;
    color: #101828;
    margin: 0 0 24px 0;
    text-align: center;
}

/* Search Input Wrapper */
.easyrx-autocomplete-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 612px;
}

/* Search Input Field */
.easyrx-autocomplete-input {
    width: 100%;
    height: 56px;
    background-color: #FFFFFF; /* White background */
    border-radius: 100px;
    border: 1px solid #D0D5DD;
    padding: 4px 20px 4px 52px; /* Space for icon on left */
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 150%;
    color: #101828;
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s ease;
}

.easyrx-autocomplete-input::placeholder {
    color: #667085; /* Light gray placeholder */
}

/* Search Icon */
.easyrx-autocomplete-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 24px;
    height: 24px;
}

/* Autocomplete Dropdown */
.easyrx-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.08), 0 4px 8px 1px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 2px;
}

/* Loading State */
.easyrx-autocomplete-loading {
    padding: 20px;
    text-align: center;
    color: #718096;
    font-style: italic;
}

/* Autocomplete Results */

/* Results container */
.easyrx-autocomplete-results {
    padding: 8px 0px;

}

/* Individual Result Item */
.easyrx-autocomplete-item {
    padding: 6px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.easyrx-autocomplete-item:hover,
.easyrx-autocomplete-item.active {
    background-color: #f8f9fa;
}

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

/* Medication Name */
.easyrx-medication-name {
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: 24px;
    color: #101828;
}

/* Generic Name */
.easyrx-medication-generic {
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 24px;
    color: #667085;
}

/* Brand Name */
.easyrx-brand-name {
    font-weight: 600;
    color: #2D3748;
}

/* Medication Details (Strength/Form) */
.easyrx-medication-details {
    font-size: 13px;
    color: #A0AEC0;
    margin-bottom: 4px;
    font-style: italic;
}

/* Medication Meta */
.easyrx-medication-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Price */
.easyrx-medication-price {
    font-weight: 600;
    color: #28a745;
    font-size: 14px;
    display: none;
}

/* Savings */
.easyrx-medication-savings {
    background: #dc3545;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    display: none;
}

/* RX Required */
.easyrx-rx-required {
    background: #ffc107;
    color: #212529;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Category Tags */
.easyrx-medication-categories {
    margin-top: 6px;
}

.easyrx-category-tag {
    display: inline-block;
    background: #E8F5E8;
    color: #2D3748;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 2px;
}

/* No Results */
.easyrx-no-results {
    padding: 20px;
    text-align: center;
    color: #718096;
    font-style: italic;
}

/* Pagination */
.easyrx-pagination {
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    background-color: #fafafa;
}

.easyrx-show-more-btn {
    background: #4299E1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.easyrx-show-more-btn:hover:not(:disabled) {
    background: #3182CE;
    transform: translateY(-1px);
}

.easyrx-show-more-btn:disabled {
    background: #CBD5E0;
    cursor: not-allowed;
    transform: none;
}

.easyrx-show-more-btn:focus {
    outline: 2px solid #4299E1;
    outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .easyrx-autocomplete-container {
        padding: 40px 20px;
        height: auto;
    }

    .easyrx-autocomplete-input-wrapper{
        max-width: 592px;
    }
    
    .easyrx-autocomplete-container > .easyrx-autocomplete-title {
        font-size: 40px;
        font-style: normal;
        font-weight: 600;
        line-height: 48px;
    }
    
    .easyrx-autocomplete-dropdown {
        max-height: 250px;
    }
    
    .easyrx-show-more-btn {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .easyrx-autocomplete-container {
        padding: 32px 16px;
    }
    
    .easyrx-autocomplete-container > .easyrx-autocomplete-title {
        font-size: 28px;
        font-style: normal;
        font-weight: 600;
        line-height: 36px;
        margin-bottom: 16px;
    }
    
    .easyrx-autocomplete-input {
        height: 56px;
        padding: 4px 20px 4px 40px;
    }
    
    .easyrx-autocomplete-icon {
        left: 12px;
        font-size: 15px;
    }
    
    .easyrx-autocomplete-dropdown {
        max-height: 200px;
    }
    
    .easyrx-autocomplete-item {
        padding: 12px 15px;
    }
    
    .easyrx-show-more-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 80px;
    }
}

/* Accessibility Improvements */
.easyrx-autocomplete-input:hover {
   border-color: #98a2b3;
}

.easyrx-autocomplete-input:focus {
    border-color: #038935;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .easyrx-autocomplete-container {
        background-color: #F7FAFC;
        border: 2px solid #2D3748;
    }
    
    .easyrx-autocomplete-input {
        border: 2px solid #2D3748;
        background-color: #FFFFFF;
    }
    
    .easyrx-autocomplete-input:focus {
        border-color: #4299E1;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .easyrx-autocomplete-input {
        transition: none;
    }
    
    .easyrx-autocomplete-input:focus {
        transform: none;
    }
    
    .easyrx-autocomplete-item {
        transition: none;
    }
}

/* Print Styles */
@media print {
    .easyrx-autocomplete-container {
        background-color: #FFFFFF;
        border: 1px solid #000000;
        padding: 20px;
    }
    
    .easyrx-autocomplete-input {
        background-color: #FFFFFF;
        border: 1px solid #000000;
        box-shadow: none;
    }
    
    .easyrx-autocomplete-dropdown {
        display: none !important;
    }
}
