/**
 * Premium Map Selector Styles
 * Ultra-premium full-screen map with glass morphism UI
 */

/* Main overlay container */
.premium-map-selector {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transform: scale(1.1);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.premium-map-selector-active {
    opacity: 1;
    transform: scale(1);
}

/* Glass morphism top bar */
.premium-map-topbar {
    position: relative;
    z-index: 10;
    height: 64px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .premium-map-topbar {
        height: 56px;
        padding: 0 12px;
    }
}

/* Close button */
.premium-map-close {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.premium-map-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.premium-map-close:active {
    transform: scale(0.95);
}

/* Title */
.premium-map-title {
    font-size: 18px;
    font-weight: 500;
    color: #111827;
    margin: 0;
    text-align: center;
    flex: 1;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
}

@media (max-width: 768px) {
    .premium-map-title {
        font-size: 16px;
    }
}

/* Save button */
.premium-map-save {
    height: 36px;
    padding: 0 20px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    -webkit-tap-highlight-color: transparent;
}

.premium-map-save:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.premium-map-save:active:not(:disabled) {
    transform: translateY(0);
}

.premium-map-save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #9CA3AF;
    box-shadow: none;
}

.premium-map-save.saving {
    pointer-events: none;
    animation: pulse 1s ease infinite;
}

.premium-map-save .save-icon {
    display: none;
}

.premium-map-save.saving .save-text {
    display: none;
}

.premium-map-save.saving .save-icon {
    display: block;
    animation: checkmark 0.4s ease;
}

/* Map container */
.premium-map-container {
    flex: 1;
    position: relative;
    background: #f3f4f6;
}

#premium-map-view {
    width: 100%;
    height: 100%;
}

/* Custom zoom controls */
.premium-map-controls {
    position: absolute;
    bottom: 120px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

@media (max-width: 768px) {
    .premium-map-controls {
        bottom: 140px;
        right: 16px;
    }
}

.map-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
    -webkit-tap-highlight-color: transparent;
}

.map-control-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.map-control-btn:active {
    transform: scale(0.95);
}

.map-control-btn.use-location {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    margin-bottom: 16px;
}

.map-control-btn.use-location.loading {
    animation: pulse 1.5s ease infinite;
}

/* Bottom info panel */
.premium-map-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 16px 20px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    z-index: 10;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

@media (min-width: 769px) {
    .premium-map-info {
        max-width: 400px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 16px 16px 0 0;
    }
}

.coordinate-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.coordinate-icon {
    font-size: 20px;
}

.coordinate-text {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.map-hint {
    font-size: 13px;
    color: #6B7280;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.map-hint.visible {
    opacity: 1;
}

/* Premium marker styles */
.premium-pin-marker {
    transition: transform 0.2s ease;
    cursor: move;
}

.premium-pin-marker.dragging {
    transform: scale(1.2);
}

.premium-pin-marker.pulse-attention {
    animation: attention-pulse 0.5s ease 3;
}

.premium-marker {
    position: relative;
}

.marker-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.4) 0%, transparent 70%);
    animation: pulse-ring 2s ease-out infinite;
}

/* Attention pulse animation for showing saved location */
@keyframes attention-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

/* Click ripple effect */
.map-click-ripple {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.6) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    animation: ripple-expand 0.6s ease-out;
    pointer-events: none;
}

/* Success ripple */
.success-ripple {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.8) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    z-index: 10000;
}

.success-ripple.active {
    animation: success-pulse 0.6s ease-out;
}

/* Toast notifications */
.premium-map-toast {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(239, 68, 68, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.premium-map-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

@keyframes ripple-expand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

@keyframes success-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
    }
    50% {
        transform: scale(1.2) rotate(-45deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Leaflet overrides for premium look */
.premium-map-container .leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 4px;
    margin: 10px;
}

/* Remove default Leaflet controls */
.premium-map-container .leaflet-control-zoom {
    display: none;
}

/* Smooth map transitions */
.premium-map-container .leaflet-container {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
}

/* Mobile safe areas */
@supports (padding: max(0px)) {
    .premium-map-topbar {
        padding-top: env(safe-area-inset-top);
        height: calc(56px + env(safe-area-inset-top));
    }
    
    .premium-map-controls {
        right: max(16px, env(safe-area-inset-right));
        bottom: max(140px, calc(140px + env(safe-area-inset-bottom)));
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .premium-map-selector {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .premium-map-topbar {
        background: rgba(31, 41, 55, 0.95);
        border-bottom-color: rgba(75, 85, 99, 0.3);
    }
    
    .premium-map-title {
        color: #F9FAFB;
    }
    
    .premium-map-close {
        color: #D1D5DB;
    }
    
    .premium-map-close:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .premium-map-info {
        background: rgba(31, 41, 55, 0.95);
        border-top-color: rgba(75, 85, 99, 0.3);
    }
    
    .coordinate-text {
        color: #E5E7EB;
    }
    
    .map-hint {
        color: #9CA3AF;
    }
    
    .map-control-btn:not(.use-location) {
        background: rgba(31, 41, 55, 0.95);
        color: #E5E7EB;
    }
}

/* ================================================
   EXPLORER CONTENT TABS
   Copied from left-menu-panel.css pattern exactly
   ================================================ */

/* Tab bar container - matches .left-menu-tabs */
.ee-content-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0;
    flex-shrink: 0;
    background: rgba(50, 50, 48, 0.4);
}

/* Individual tab button - matches .left-menu-tab exactly */
.ee-content-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    font-family: inherit;
}

.ee-content-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.05);
}

.ee-content-tab.active {
    color: white;
}

/* Active tab underline indicator - matches .left-menu-tab.active::after */
.ee-content-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #4facfe;
}

/* Tab icon - matches .left-menu-tab .tab-icon */
.ee-content-tab .ee-tab-icon {
    font-size: 16px;
}

/* Tab panels container */
.ee-tab-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.ee-tab-panel.active {
    display: flex;
}

/* ================================================
   LISTINGS TAB CONTENT
   ================================================ */

.ee-listings-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.ee-listings-scrollable::-webkit-scrollbar {
    width: 6px;
}

.ee-listings-scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.ee-listings-scrollable::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.ee-listings-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ee-listings-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Listing card */
.ee-listing-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ee-listing-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(79, 172, 254, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ee-listing-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: rgba(50, 48, 45, 0.5);
}

.ee-listing-info {
    padding: 12px;
}

.ee-listing-title {
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ee-listing-price {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

/* Loading state */
.ee-listings-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    gap: 12px;
}

.ee-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: #4facfe;
    border-radius: 50%;
    animation: ee-spin 0.8s linear infinite;
}

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

/* Empty state */
.ee-listings-empty {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.ee-listings-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.ee-listings-empty p {
    margin: 0 0 16px 0;
    font-size: 14px;
}

.ee-create-listing-btn {
    padding: 10px 20px;
    background: rgba(79, 172, 254, 0.15);
    border: 1px solid rgba(79, 172, 254, 0.3);
    border-radius: 8px;
    color: #4facfe;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ee-create-listing-btn:hover {
    background: rgba(79, 172, 254, 0.25);
    border-color: rgba(79, 172, 254, 0.5);
}

/* Fixed footer with fullscreen button */
.ee-listings-footer {
    flex-shrink: 0;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(55, 52, 50, 0.5);
    display: flex;
    gap: 8px;
}

/* Professional segmented toggle */
.ee-mode-toggle {
    position: relative;
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

/* Sliding background indicator - Guest (left) is green, Host (right) is blue */
.ee-mode-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 4px);
    height: calc(100% - 6px);
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.9) 0%, rgba(129, 199, 132, 0.9) 100%);
    border-radius: 6px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.25s ease;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

/* Slider position for host mode (slides right) */
.ee-mode-toggle.host-active .ee-mode-slider {
    transform: translateX(calc(100% + 2px));
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.9) 0%, rgba(0, 242, 254, 0.9) 100%);
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
}

/* Individual option button */
.ee-mode-option {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.ee-mode-option:hover:not(.active) {
    color: rgba(255, 255, 255, 0.7);
}

.ee-mode-option.active {
    color: #fff;
}

/* Host status icon (lock/unlock) */
.ee-host-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-left: 4px;
}

.ee-host-status svg {
    width: 14px;
    height: 14px;
}

.ee-host-status.locked {
    color: #fff;
    opacity: 0.95;
}

.ee-host-status.unlocked {
    color: #4caf50;
}

/* Host locked verification content */
.ee-host-locked-content {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    gap: 16px;
}

.ee-host-locked-content > svg {
    width: 48px;
    height: 48px;
    stroke: rgba(255, 255, 255, 0.4);
}

.ee-host-locked-content h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.ee-verification-requirement {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 8px;
}

.ee-verification-requirement svg {
    width: 20px;
    height: 20px;
    stroke: #ff9800;
    flex-shrink: 0;
}

.ee-verification-requirement span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.ee-verify-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ee-verify-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 16px rgba(79, 172, 254, 0.4);
}

.ee-fullscreen-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(79, 172, 254, 0.15);
    border: 1px solid rgba(79, 172, 254, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ee-fullscreen-btn:hover {
    background: rgba(79, 172, 254, 0.25);
    border-color: rgba(79, 172, 254, 0.5);
}

.ee-fullscreen-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* HOST/GUEST mode tab containers */
.ee-host-tabs,
.ee-guest-tabs {
    display: flex;
    gap: 4px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ee-content-tab {
        padding: 10px 12px;
        gap: 6px;
        font-size: 12px;
    }

    .ee-content-tab .ee-tab-icon {
        width: 14px;
        height: 14px;
    }
}
