/**
 * Variety Suggestions CSS
 *
 * Styles for the variety suggestions dropdown.
 */

/* Variety Field Container */
.esc-variety-field-container {
    position: relative;
}

/* Style for the variety field to indicate it's clickable */
#esc_variety_name {
    cursor: pointer;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23718096" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 30px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Style for when the dropdown is open */
#esc_variety_name.dropdown-open {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%234299e1" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 15l-6-6-6 6"/></svg>');
}

/* Variety Dropdown */
#esc-variety-dropdown,
.esc-variety-dropdown {
    position: absolute;
    top: calc(100% + 5px); /* Position below the input with a small gap */
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    margin-top: 2px;
    display: none;
}

/* Variety Options */
.esc-variety-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    color: #4a5568;
    display: block;
    border-bottom: 1px solid #f0f4f8;
}

.esc-variety-option:hover {
    background-color: #ebf5fb;
}

.esc-variety-option:last-child {
    border-bottom: none;
}

/* Empty message */
.esc-variety-empty {
    padding: 10px 12px;
    font-size: 14px;
    color: #718096;
    text-align: center;
    font-style: italic;
}

/* Error message */
.esc-variety-error {
    padding: 10px 12px;
    font-size: 14px;
    color: #e53e3e;
    text-align: center;
    font-style: italic;
}

/* Loading Indicator */
.esc-variety-loading {
    margin-top: 5px;
    color: #718096;
    font-size: 13px;
    display: flex;
    align-items: center;
}

.esc-variety-loading .dashicons {
    margin-right: 5px;
}

/* Spin Animation */
.esc-spin {
    animation: esc-spin 2s linear infinite;
    display: inline-block;
}

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

/* Responsive Styles */
@media (max-width: 767px) {
    #esc-variety-dropdown,
    .esc-variety-dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
    }
}
