/**
 * Floating Map Filter Widget Custom Styles
 */

:root {
    --map-widget-primary: #584a5e;
    --map-widget-primary-light: #7c6a83;
    --map-widget-gradient: linear-gradient(135deg, #7c6a83 0%, #584a5e 100%);
    --map-widget-bg-window: #ffffff;
    --map-widget-shadow: 0 16px 48px rgba(88, 74, 94, 0.16);
    --map-widget-shadow-launcher: 0 8px 32px rgba(88, 74, 94, 0.32);
    --map-widget-border-radius-lg: 20px;
    --map-widget-border-radius-md: 14px;
    --map-widget-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --map-widget-font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Container */
#traveltips-map-widget-container {
    position: fixed;
    bottom: 105px;
    right: 30px;
    z-index: 99997; /* Just below chatbot z-index 99999 */
    font-family: var(--map-widget-font-family);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Floating Launcher */
.traveltips-map-widget-launcher {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--map-widget-gradient);
    border: none;
    cursor: grab;
    box-shadow: var(--map-widget-shadow-launcher);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: var(--map-widget-transition);
    outline: none;
    z-index: 10;
}

.traveltips-map-widget-launcher:hover {
    transform: scale(1.08) rotate(5deg);
    box-shadow: 0 12px 36px rgba(88, 74, 94, 0.45);
}

.traveltips-map-widget-launcher:active {
    transform: scale(0.95);
}

.traveltips-map-widget-launcher svg {
    width: 26px;
    height: 26px;
    transition: var(--map-widget-transition);
}

/* Glow Effect */
.launcher-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--map-widget-gradient);
    opacity: 0.3;
    z-index: -1;
    animation: map-launcher-pulse 2s infinite;
}

@keyframes map-launcher-pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Map Window */
.traveltips-map-widget-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 580px;
    background: var(--map-widget-bg-window);
    border-radius: var(--map-widget-border-radius-lg);
    box-shadow: var(--map-widget-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: var(--map-widget-transition);
    border: 1px solid rgba(88, 74, 94, 0.1);
    z-index: 12;
}

.traveltips-map-widget-window.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Header Styling */
.widget-header {
    background: var(--map-widget-gradient);
    padding: 16px 20px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.widget-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.widget-header .header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.widget-header .avatar-container {
    position: relative;
}

.widget-header .avatar-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.widget-header .status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--map-widget-primary);
}

.widget-header .status-dot.online {
    background-color: #2ec4b6; /* teal/green color */
    animation: widget-status-blink 1.5s infinite;
}

@keyframes widget-status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.widget-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.widget-subtitle {
    margin: 2px 0 0;
    font-size: 11px;
    opacity: 0.85;
    line-height: 1.2;
}

.widget-header .header-actions button {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--map-widget-transition);
    opacity: 0.8;
}

.widget-header .header-actions button:hover {
    background: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

/* Body Styling */
.widget-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fdfcff;
}

.filter-section {
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid rgba(88, 74, 94, 0.08);
}

.filter-heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--map-widget-primary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form controls */
.form-label-custom {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.form-select-custom {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid rgba(88, 74, 94, 0.15);
    border-radius: 8px;
    background-color: #f7f6f8;
    color: #2d3748;
    outline: none;
    transition: var(--map-widget-transition);
    font-family: var(--map-widget-font-family);
    box-sizing: border-box;
}

.form-select-custom:focus {
    border-color: var(--map-widget-primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(88, 74, 94, 0.1);
}

.btn-filter-submit {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--map-widget-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--map-widget-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-filter-submit:hover {
    background-color: var(--map-widget-primary-light);
    transform: translateY(-1px);
}

.btn-filter-submit:active {
    transform: translateY(0);
}

/* Map area */
.widget-map-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #edf2f7;
}

.widget-map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    transition: var(--map-widget-transition);
}

/* Utility Helpers */
.d-none {
    display: none !important;
}

/* RESPONSIVE DESIGN */
@media (max-width: 991px) {
    #traveltips-map-widget-container {
        bottom: 85px;
        right: 25px;
    }
    
    .traveltips-map-widget-launcher {
        width: 50px;
        height: 50px;
    }
    
    .traveltips-map-widget-launcher svg {
        width: 22px;
        height: 22px;
    }
    
    .traveltips-map-widget-window {
        bottom: 80px;
        right: 0;
        width: calc(100vw - 40px);
        height: calc(100vh - 240px); /* Fallback */
        height: calc(100svh - 240px);
        max-height: 520px;
    }
}

/* Mobile Tab Switcher Styles */
.widget-mobile-tabs {
    display: none;
    padding: 10px 16px;
    background: #fdfcff;
    border-bottom: 1px solid rgba(88, 74, 94, 0.08);
    gap: 10px;
}

.widget-tab-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #718096;
    background: #f7f6f8;
    border: 1px solid rgba(88, 74, 94, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: var(--map-widget-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.widget-tab-btn i {
    font-size: 14px;
}

.widget-tab-btn:hover {
    color: var(--map-widget-primary);
    background: #ffffff;
    border-color: rgba(88, 74, 94, 0.2);
}

.widget-tab-btn.active {
    color: #ffffff;
    background: var(--map-widget-gradient);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(88, 74, 94, 0.2);
}

@media (max-width: 991px) {
    .widget-mobile-tabs {
        display: flex;
    }
    
    .widget-body.show-map-tab .filter-section {
        display: none !important;
    }
    
    .widget-body.show-filter-tab .widget-map-container {
        display: none !important;
    }
}

/* Scroll Lock Helper */
html.map-widget-open, body.map-widget-open,
html.chatbot-open, body.chatbot-open {
    overflow: hidden !important;
    height: 100% !important;
}
