/**
 * Saudi Address Pro - Widget Styles
 * 
 * @package SaudiAddressPro
 */

.saudadpr-widget {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
}

.saudadpr-widget[dir="rtl"] {
    text-align: right;
}

.saudadpr-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.saudadpr-label-icon {
    font-size: 16px;
    line-height: 1;
}

.saudadpr-label-text {
    line-height: 1.2;
}

.saudadpr-input-wrapper {
    position: relative;
}

#saudadpr-search {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

#saudadpr-search:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#saudadpr-search::placeholder {
    color: #9ca3af;
}

.saudadpr-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #e1e4e8;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.saudadpr-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

.saudadpr-result-item:last-child {
    border-bottom: none;
}

.saudadpr-result-item:hover {
    background: #f8f9fa;
}

.saudadpr-result-main {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 2px;
}

.saudadpr-result-secondary {
    font-size: 12px;
    color: #6b7280;
}

.saudadpr-loading,
.saudadpr-no-results,
.saudadpr-error {
    padding: 15px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.saudadpr-error {
    color: #dc2626;
}

/* RTL Support */
.saudadpr-widget[dir="rtl"] .saudadpr-results {
    text-align: right;
}

.saudadpr-widget[dir="rtl"] .saudadpr-label {
    flex-direction: row-reverse;
}

/* Block Checkout Specific */
.saudadpr-block-checkout {
    margin: 16px 0;
}

/* Responsive */
@media (max-width: 768px) {
    .saudadpr-widget {
        padding: 10px;
    }
    
    #saudadpr-search {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .saudadpr-result-item {
        padding: 10px 12px;
    }
}

/* Field highlight animation when address is selected */
.saudadpr-field-highlight {
    background-color: rgba(37, 99, 235, 0.1) !important;
    border-color: #2563eb !important;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

@keyframes saudadpr-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.saudadpr-field-highlight {
    animation: saudadpr-pulse 0.6s ease-out;
}
