/**
 * Subasto Location Features Styles
 */

/* Map Container */
#map-container {
    transition: all 0.3s ease;
}

#auction-map {
    width: 100%;
    height: 500px;
    border-radius: 1rem;
    z-index: 1;
}

@media (max-width: 768px) {
    #auction-map {
        height: 350px;
    }
}

/* Custom Leaflet Styles */
.leaflet-container {
    background: #1a1a1a;
    font-family: 'Manrope', sans-serif;
}

.leaflet-tile-pane {
    filter: saturate(0.8) brightness(0.9);
}

.leaflet-popup-content-wrapper {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.leaflet-popup-content {
    margin: 12px 16px;
    color: #fff;
}

.leaflet-popup-tip {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaflet-control-zoom {
    border: none !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: rgba(20, 20, 20, 0.9) !important;
    color: #eab308 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(40, 40, 40, 0.95) !important;
    color: #fff !important;
}

.leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.7) !important;
    color: #666 !important;
    font-size: 10px;
}

.leaflet-control-attribution a {
    color: #888 !important;
}

/* Marker Clusters */
.marker-cluster {
    background: transparent;
}

.cluster-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.cluster-small {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.cluster-medium {
    background: linear-gradient(135deg, #eab308, #ca8a04);
}

.cluster-large {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* User Marker */
.user-marker {
    z-index: 1000 !important;
}

.user-marker > div {
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }
}

/* Auction Marker */
.auction-marker > div {
    transition: transform 0.2s ease;
}

.auction-marker:hover > div {
    transform: scale(1.2);
}

/* Location Badge */
.location-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 500;
}

.location-badge-near {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.location-badge-medium {
    background: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
}

.location-badge-far {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* Transport Cost Display */
.transport-cost-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.transport-cost-card h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
}

.transport-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.transport-option:last-child {
    border-bottom: none;
}

.transport-option-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.transport-option-price {
    font-weight: 600;
    font-size: 14px;
}

.transport-option-price.freight {
    color: #f97316;
}

.transport-option-price.pickup {
    color: #22c55e;
}

/* Near Me Button */
#near-me-btn {
    transition: all 0.2s ease;
}

#near-me-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#near-me-btn:hover:not(:disabled) {
    background: rgba(234, 179, 8, 0.2);
}

/* Radius Filter */
#radius-filter-container {
    transition: all 0.3s ease;
}

#radius-filter {
    background: rgba(26, 26, 26, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#radius-filter:focus {
    outline: none;
    border-color: rgba(234, 179, 8, 0.5);
}

#radius-filter option {
    background: #1a1a1a;
    color: #fff;
}

/* Province Filter Enhancement */
#province-filter {
    background: rgba(26, 26, 26, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 14px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

#province-filter:focus {
    outline: none;
    border-color: rgba(234, 179, 8, 0.5);
}

/* Map Toggle Animation */
.map-toggle-enter {
    opacity: 0;
    transform: translateY(-10px);
}

.map-toggle-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Total Cost Display with Transport */
.total-cost-breakdown {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.total-cost-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
}

.total-cost-row.highlight {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 8px;
    margin-top: 4px;
}

.total-cost-row .label {
    color: rgba(255, 255, 255, 0.5);
}

.total-cost-row .value {
    font-weight: 600;
}

.total-cost-row .value.auction {
    color: #eab308;
}

.total-cost-row .value.transport {
    color: #f97316;
}

.total-cost-row .value.total {
    color: #22c55e;
    font-size: 14px;
}

/* Loading States */
.location-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.location-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(234, 179, 8, 0.3);
    border-top-color: #eab308;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 640px) {
    .location-controls {
        flex-direction: column;
        gap: 8px;
    }

    .location-controls > * {
        width: 100%;
    }

    #radius-filter {
        width: 100%;
    }
}

/* Map Legend */
.map-legend {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    bottom: 30px;
    right: 10px;
    z-index: 1000;
}

.map-legend h5 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    padding: 4px 0;
}

.map-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.map-legend-dot.vehicles { background: #3b82f6; }
.map-legend-dot.real_estate { background: #ec4899; }
.map-legend-dot.machinery { background: #eab308; }
.map-legend-dot.general_goods { background: #22c55e; }
.map-legend-dot.other { background: #9ca3af; }
