/**
 * Premium Styling for VSW Geolocation Leaflet Map on Checkout
 */

.vsw-map-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.vsw-map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.vsw-map-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vsw-map-title::before {
    content: "📍";
    font-size: 16px;
}

.vsw-locate-btn {
    background: linear-gradient(135deg, #ee0033 0%, #c40026 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(238, 0, 51, 0.2);
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vsw-locate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(238, 0, 51, 0.3);
}

.vsw-locate-btn:active {
    transform: translateY(0);
}

.vsw-locate-btn.locating {
    background: #718096;
    box-shadow: none;
    cursor: not-allowed;
}

.vsw-locate-btn.locating::after {
    content: "";
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: vsw-spin 0.8s linear infinite;
    display: inline-block;
}

#vsw-checkout-map {
    height: 300px;
    width: 100%;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    z-index: 10;
}

.vsw-map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
    transition: opacity 0.3s ease;
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
}

.vsw-map-loading-overlay.active {
    pointer-events: auto;
    opacity: 1;
}

.vsw-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #ee0033;
    border-radius: 50%;
    animation: vsw-spin 1s linear infinite;
    margin-bottom: 8px;
}

.vsw-loading-text {
    font-size: 12px;
    color: #4a5568;
    font-weight: 500;
}

.vsw-map-feedback {
    background: rgba(247, 250, 252, 0.95);
    border: 1px solid #edf2f7;
    border-radius: 6px;
    padding: 10px 12px;
    margin-top: 10px;
    font-size: 12px;
    color: #4a5568;
    line-height: 1.5;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.vsw-map-feedback strong {
    color: #2d3748;
}

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

/* Custom styles for Leaflet elements inside checkout */
.leaflet-container {
    font-family: inherit;
}

.leaflet-bar {
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.leaflet-bar a {
    border-bottom: 1px solid #edf2f7 !important;
}

.leaflet-bar a:last-child {
    border-bottom: none !important;
}

/* Premium Glassmorphic Fullscreen Geolocation Modal Overlay */
.vsw-silent-geo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 1;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.vsw-silent-geo-modal.fade-out {
    opacity: 0;
    visibility: hidden;
}

.vsw-silent-geo-content {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: vsw-scale-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.vsw-silent-geo-icon {
    font-size: 40px;
    margin-bottom: 16px;
    animation: vsw-pulse-pin 2s infinite ease-in-out;
}

.vsw-silent-geo-content h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.vsw-silent-geo-content p {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

.vsw-silent-geo-loader {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.vsw-silent-geo-loader .vsw-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(15, 23, 42, 0.1);
    border-top-color: #ee0033;
    border-radius: 50%;
    animation: vsw-spin 0.8s linear infinite;
    margin: 0;
}

.vsw-geo-close-btn {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.vsw-geo-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

@keyframes vsw-scale-up {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes vsw-pulse-pin {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}
