/**
 * WooCommerce City & Street Selector - Styles
 * Version: 1.0.0
 */

/* שדות Select2 */
.wccs-city-select .select2-container,
.wccs-street-select .select2-container {
    width: 100% !important;
}

.wccs-city-select .select2-selection,
.wccs-street-select .select2-selection {
    min-height: 40px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.wccs-city-select .select2-selection:focus,
.wccs-street-select .select2-selection:focus {
    border-color: #5b9dd9;
    box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
}

/* תמיכה ב-RTL */
.rtl .wccs-city-select .select2-container,
.rtl .wccs-street-select .select2-container {
    direction: rtl;
    text-align: right;
}

.rtl .select2-results__option {
    text-align: right;
}

/* מצב טעינה */
.wccs-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.wccs-loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: wccs-spin 1s linear infinite;
}

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

/* שדות נעולים */
.wccs-city-select select:disabled,
.wccs-street-select select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* הודעות שגיאה */
.wccs-city-select.woocommerce-invalid .select2-selection,
.wccs-street-select.woocommerce-invalid .select2-selection {
    border-color: #e2401c;
}

.wccs-city-select.woocommerce-validated .select2-selection,
.wccs-street-select.woocommerce-validated .select2-selection {
    border-color: #69bf29;
}

/* שיפורי תצוגה למובייל */
@media screen and (max-width: 768px) {
    .wccs-city-select .select2-selection,
    .wccs-street-select .select2-selection {
        min-height: 45px;
        font-size: 16px;
    }
    
    .select2-dropdown {
        font-size: 16px;
    }
    
    .select2-results__option {
        padding: 10px;
    }
}

/* עיצוב התפריט הנפתח */
.select2-dropdown {
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.select2-results__option--highlighted {
    background-color: #5897fb;
    color: white;
}

.select2-results__option--selected {
    background-color: #f5f5f5;
}

/* שדה חיפוש בתוך התפריט */
.select2-search--dropdown .select2-search__field {
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 6px;
    width: 100%;
    box-sizing: border-box;
}

.rtl .select2-search--dropdown .select2-search__field {
    direction: rtl;
    text-align: right;
}

/* אייקון החץ */
.select2-selection__arrow {
    height: 100%;
    top: 0;
}

.rtl .select2-selection__arrow {
    left: 5px;
    right: auto;
}

/* התאמות לתבנית Storefront */
.storefront .wccs-city-select,
.storefront .wccs-street-select {
    margin-bottom: 1em;
}

/* התאמות לתבנית Flatsome */
.flatsome .wccs-city-select .select2-selection,
.flatsome .wccs-street-select .select2-selection {
    background-color: #fff;
    height: auto;
}

/* Placeholder */
.select2-selection__placeholder {
    color: #999;
}

/* נגישות */
.wccs-city-select label,
.wccs-street-select label {
    font-weight: 600;
    margin-bottom: 5px;
    display: block;
}

.wccs-city-select .select2-selection:focus,
.wccs-street-select .select2-selection:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* אנימציה לשינוי ערכים */
.wccs-city-select select,
.wccs-street-select select {
    transition: all 0.3s ease;
}

/* טיפ כלי */
.wccs-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.wccs-tooltip:hover .wccs-tooltiptext {
    visibility: visible;
    opacity: 1;
}

.wccs-tooltiptext {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    white-space: nowrap;
}

.wccs-tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}