/* Google Maps Geocoding Enhanced Styles */

.pac-container {
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    z-index: 9999 !important;
    overflow: hidden;
}

.pac-item {
    padding: 14px 18px;
    border-bottom: 1px solid #f7fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.pac-item:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

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

.pac-item-selected {
    background-color: #e3f2fd !important;
    border-left: 4px solid #1976d2;
}

.pac-matched {
    font-weight: 600;
    color: #1976d2;
    background-color: rgba(25, 118, 210, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
}

.pac-icon {
    margin-right: 10px;
    opacity: 0.7;
}

/* Geocoding Button Container */
.geocoding-button-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* Main Geocoding Button */
.geocoding-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.geocoding-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.geocoding-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.geocoding-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Current Location Button */
.geocoding-button-container .btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.2);
}

.geocoding-button-container .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(72, 187, 120, 0.3);
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

/* Loading Animation */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Icon Styles */
.geocoding-button svg,
.geocoding-button-container .btn-success svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Form Integration */
.form-group .geocoding-button-container {
    margin-top: 12px;
}

/* Vendor Category Styles */
.vendor-category-select {
    position: relative;
}

.vendor-category-select .form-control {
    padding-right: 40px;
}

.vendor-category-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.6;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pac-container {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .pac-item {
        border-bottom-color: #4a5568;
    }
    
    .pac-item:hover {
        background-color: #4a5568;
    }
    
    .pac-item-selected {
        background-color: #3182ce !important;
        border-left-color: #63b3ed;
    }
    
    .pac-matched {
        color: #63b3ed;
        background-color: rgba(99, 179, 237, 0.1);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .pac-container {
        font-size: 14px;
        border-radius: 8px;
    }
    
    .pac-item {
        padding: 12px 16px;
    }
    
    .geocoding-button-container {
        flex-direction: column;
    }
    
    .geocoding-button,
    .geocoding-button-container .btn-success {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .geocoding-button-container {
        margin-top: 16px;
    }
}

@media (max-width: 480px) {
    .geocoding-button,
    .geocoding-button-container .btn-success {
        padding: 12px 16px;
        font-size: 15px;
    }
}

/* Success/Error Messages */
.geocoding-message {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.geocoding-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.geocoding-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.geocoding-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Loading State */
.geocoding-loading {
    position: relative;
    overflow: hidden;
}

.geocoding-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}
