/**
 * Google Maps Locker Picker Styles
 *
 * @package CourierGuys\Pudo
 */

/* Map Container */
.locker-map-container,
.pudo-map-container {
    display: none;
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    overflow: hidden;
}

.locker-map-header {
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    padding: 15px;
}

.locker-map-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.map-address-search-container {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 250px;
}

.map-address-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.map-address-search,
.get-current-location,
.address-search {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.map-address-search:hover,
.get-current-location:hover {
    background: #005a87;
}

.get-current-location {
    background: #27ae60;
}

.get-current-location:hover {
    background: #219a52;
}

/* Toggle Button */
.toggle-map-view {
    background: #666;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 10px;
}

.toggle-map-view:hover {
    background: #555;
}

.toggle-map-view .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Map Canvas */
.locker-map-canvas {
    height: 400px;
    width: 100%;
    background: #f0f0f0;
}

/* Info Window Styles */
.locker-info-window {
    max-width: 300px;
    padding: 10px;
}

.locker-info-window h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.locker-info-window .locker-code {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-family: monospace;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.locker-info-window .locker-address {
    color: #555;
    font-size: 13px;
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.locker-info-window .locker-distance {
    color: #0073aa;
    font-size: 12px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.locker-info-window .locker-hours {
    color: #666;
    font-size: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.locker-info-window .locker-actions {
    margin-top: 10px;
}

.locker-info-window .select-locker-from-map {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    justify-content: center;
}

.locker-info-window .select-locker-from-map:hover {
    background: #219a52;
}

.locker-info-window .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Loading States */
.get-current-location .dashicons.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Map Status Messages */
.map-status-message {
    padding: 15px;
    text-align: center;
    color: #666;
    font-style: italic;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
}

.map-status-message.error {
    color: #d63638;
    background: #fdf2f2;
}

.map-status-message.success {
    color: #00a32a;
    background: #f0f6fc;
}

/* Enhanced Locker Search Section */
.locker-search-enhanced {
    position: relative;
}

.locker-search-enhanced .locker-search {
    margin-bottom: 10px;
}

.locker-search-enhanced .search-options {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.locker-search-enhanced .search-radius {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #666;
}

.locker-search-enhanced .search-radius select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .locker-map-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .map-address-search-container {
        min-width: auto;
        width: 100%;
    }
    
    .toggle-map-view {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .locker-map-canvas {
        height: 300px;
    }
    
    .locker-info-window {
        max-width: 250px;
    }
    
    .search-options {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .locker-map-header {
        padding: 10px;
    }
    
    .locker-map-canvas {
        height: 250px;
    }
    
    .map-address-search-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .map-address-search,
    .get-current-location {
        width: 100%;
        justify-content: center;
    }
}

/* Integration with existing checkout styles */
.courier-guys-pudo-locker-field .locker-map-container {
    margin-top: 15px;
}

.courier-guys-pudo-locker-field .toggle-map-view {
    margin-top: 10px;
}

/* Locker marker styles */
.locker-marker {
    width: 40px;
    height: 40px;
    background: #0073aa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.locker-marker:hover {
    background: #005a87;
    transform: scale(1.1);
}

/* Map marker clustering styles (if needed) */
.cluster {
    background: #0073aa;
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.cluster-small {
    width: 30px;
    height: 30px;
}

.cluster-medium {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

.cluster-large {
    width: 50px;
    height: 50px;
    font-size: 16px;
}

/* Accessibility improvements */
.locker-map-container [role="button"],
.locker-map-container button {
    outline: none;
}

.locker-map-container [role="button"]:focus,
.locker-map-container button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .locker-map-container,
    .toggle-map-view {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .locker-map-container {
        border: 2px solid #000;
    }
    
    .map-address-search,
    .get-current-location,
    .toggle-map-view {
        border: 1px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .get-current-location .dashicons.spin {
        animation: none;
    }
    
    .locker-map-container * {
        transition: none !important;
    }
}
