/**
 * City Autocomplete - Styles
 * @since 1.7.0
 */

/* Autocomplete Wrapper */
.ds-autocomplete-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

/* Input Field */
.ds-city-autocomplete {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.ds-city-autocomplete:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.ds-city-autocomplete:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

/* Results Container */
.ds-autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.ds-autocomplete-results.show {
    display: block;
}

/* Results List */
.ds-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Result Item */
.ds-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.15s;
}

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

.ds-result-item:hover,
.ds-result-item.active {
    background-color: #f5f9fc;
}

.ds-result-item strong {
    color: #2271b1;
    font-weight: 600;
}

/* City Name */
.ds-city-name {
    font-size: 14px;
    line-height: 1.4;
    color: #2c3338;
    margin-bottom: 4px;
}

/* City Meta */
.ds-city-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Badges */
.ds-badge-exists {
    display: inline-block;
    padding: 2px 6px;
    background: #d4edda;
    color: #155724;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

.ds-badge-new {
    display: inline-block;
    padding: 2px 6px;
    background: #fff3cd;
    color: #856404;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
}

/* Loading State */
.ds-results-loading {
    padding: 20px 12px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.ds-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: ds-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Empty/Error States */
.ds-results-empty,
.ds-results-error {
    padding: 20px 12px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.ds-results-error {
    color: #d63638;
}

/* Location Hint */
.ds-location-hint {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f6fc;
    border-left: 3px solid #2271b1;
    font-size: 13px;
    color: #2c3338;
    border-radius: 3px;
    display: none;
}

.ds-location-hint strong {
    color: #2271b1;
}

/* Notification */
.ds-notification {
    position: fixed;
    top: 32px;
    right: 20px;
    padding: 12px 20px;
    background: #fff;
    border-left: 4px solid #2271b1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.ds-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.ds-notification-success {
    border-left-color: #00a32a;
    color: #00a32a;
}

.ds-notification-error {
    border-left-color: #d63638;
    color: #d63638;
}

/* Admin Meta Box Styles */
.ds-city-meta-box {
    padding: 10px;
}

.ds-city-meta-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.ds-city-meta-box .description {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 782px) {
    .ds-autocomplete-wrapper {
        max-width: 100%;
    }
    
    .ds-notification {
        top: 46px;
        right: 10px;
        left: 10px;
    }
}

/* Frontend Styles */
.frontend .ds-autocomplete-wrapper {
    max-width: 100%;
}

.frontend .ds-city-autocomplete {
    font-size: 16px;
    padding: 12px 16px;
}

.frontend .ds-result-item {
    padding: 12px 16px;
}

.frontend .ds-city-name {
    font-size: 15px;
}

.frontend .ds-city-meta {
    font-size: 13px;
}


