/* ============================================
   AI-POWERED SPLIT SCREEN LAYOUT
   ============================================ */

/* Hide old navigation in AI mode */
.horizontal-nav {
    display: none !important;
}

/* Reset body and html for full screen */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

.ai-map-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}

/* LEFT PANEL: Chat */
.ai-chat-panel {
    width: 400px;
    min-width: 350px;
    max-width: 500px;
    background: #ffffff;
    border-right: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    z-index: 100;
    height: 100vh;
    flex-shrink: 0; /* Prevent shrinking */
}

.chat-header {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0; /* Prevent header from shrinking */
}

.chat-header h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 700;
    color: white;
}

.chat-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
    color: white;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #f9fafb;
}

.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
    flex-shrink: 0; /* Prevent input area from shrinking */
}

#chatInput {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    resize: none;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.2s;
    min-height: 50px;
}

#chatInput:focus {
    outline: none;
    border-color: #667eea;
}

#sendBtn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

#sendBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#sendBtn:active {
    transform: translateY(0);
}

/* RIGHT PANEL: Map & Rankings */
.map-panel {
    flex: 1;
    position: relative;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Map takes full space */
.map-panel .map-section {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.map-panel #map {
    width: 100%;
    height: 100%;
}

/* Ranking section overlays on right side */
.map-panel .ranking-section {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 350px;
    background: white;
    overflow-y: auto;
    border-left: 1px solid #e5e7eb;
    z-index: 10;
    box-shadow: -2px 0 8px rgba(0,0,0,0.1);
}

/* Ensure ranking header is visible */
.ranking-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.ranking-header h2 {
    margin: 0 0 8px 0;
    color: white;
    font-size: 20px;
}

.ranking-subtitle {
    margin: 0 0 12px 0;
    opacity: 0.9;
    font-size: 14px;
    color: white;
}

.current-bundle-display {
    background: rgba(255,255,255,0.2);
    padding: 8px 12px;
    border-radius: 20px;
    display: inline-block;
    font-size: 12px;
}

/* Ranking tiles scrollable area */
.ranking-tiles {
    padding: 15px;
}

/* Individual tile styling */
.ranking-tile {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.ranking-tile:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.rank-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.location-info {
    flex: 1;
}

.location-info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #1f2937;
}

.location-info p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

/* Hide loading screen when AI loads */
.loading-screen.hidden {
    display: none !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .ai-map-container {
        flex-direction: column;
    }
    
    .ai-chat-panel {
        width: 100%;
        max-width: none;
        height: 40vh;
        border-right: none;
        border-bottom: 2px solid #e5e7eb;
    }
    
    .map-panel {
        height: 60vh;
    }
    
    .map-panel .ranking-section {
        position: relative;
        width: 100%;
        height: auto;
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
}

/* ============================================
   DEMO CHAT BUTTONS
   ============================================ */

.demo-query-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.demo-query-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

/* Message animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ====================================================================
   DATA SOURCE BADGES - FINAL VERSION
   ==================================================================== */

/* Target badges by title attribute for sidebar */
span[title*="Google Places"],
span[title*="Google"] {
    display: inline-block !important;
    background: #4285F4 !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-left: 10px !important;
    vertical-align: middle !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}

span[title*="Yelp"] {
    display: inline-block !important;
    background: #D32323 !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-left: 10px !important;
    vertical-align: middle !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}

span[title*="World Bank"] {
    display: inline-block !important;
    background: #009FDA !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-left: 10px !important;
    vertical-align: middle !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}

/* Fallback for any official badge */
.official-badge {
    display: inline-block !important;
    background: #3b82f6 !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-left: 10px !important;
    vertical-align: middle !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}

/* Curated badge */
.curated-badge {
    display: inline-block !important;
    background: #10b981 !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-left: 10px !important;
    vertical-align: middle !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}

/* AI badge */
.ai-badge {
    display: inline-block !important;
    background: #f59e0b !important;
    color: white !important;
    padding: 4px 12px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-left: 10px !important;
    vertical-align: middle !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15) !important;
}
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
}

/* Make sure parent containers don't collapse */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* Map wrapper if you have one */
.map-container {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* Mapbox markers - ensure they're visible */
.mapboxgl-marker {
    z-index: 1000 !important;
}

.ranking-marker {
    cursor: pointer !important;
}

/* About Button */
.ranking-footer {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    background: #f9fafb;
}

.about-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.about-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.about-icon {
    font-size: 16px;
}

/* About Modal - ADD ALL THE CSS I GAVE YOU EARLIER */
.about-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
}

.about-modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================================
   FLOATING ABOUT BUTTON (Over Map)
   ================================ */

.floating-about-btn {
    position: absolute;
    bottom: 90px;  /* Above the Quick Tour button */
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.floating-about-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.floating-about-btn:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .floating-about-btn {
        bottom: 80px;
        right: 15px;
        padding: 10px 16px;
        font-size: 13px;
    }
}
.about-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Modal Overlay - VISIBLE when show class added */
.about-modal-overlay.show {
    display: flex !important;
    opacity: 1;
}

.about-modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 100000;
    pointer-events: auto; /* ← IMPORTANT! */
}

.about-modal-overlay.show .about-modal-content {
    transform: scale(1);
}
/* Modal Header */
.about-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.about-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.about-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal Body */
.about-modal-body {
    padding: 28px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

/* Scrollbar styling */
.about-modal-body::-webkit-scrollbar {
    width: 8px;
}

.about-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.about-modal-body::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

/* Tagline */
.about-tagline {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid #e5e7eb;
}

.about-tagline h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.tagline-sub {
    font-size: 16px;
    color: #6b7280;
    font-style: italic;
    margin: 0;
}

/* Sections */
.about-section {
    margin-bottom: 24px;
}

.about-section h4 {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.about-section p {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0 0 12px 0;
}

.about-section ul {
    margin: 12px 0;
    padding-left: 20px;
}

.about-section li {
    font-size: 14px;
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 8px;
}

.about-section li strong {
    color: #1f2937;
    font-weight: 600;
}

/* Notes */
.data-note,
.vision-note {
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
    margin-top: 12px;
    padding: 12px;
    background: #f9fafb;
    border-left: 3px solid #667eea;
    border-radius: 4px;
}

/* Feedback Email */
.feedback-email {
    font-size: 15px;
    font-weight: 600;
    margin-top: 12px;
}

.feedback-email a {
    color: #667eea;
    text-decoration: none;
}

.feedback-email a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Links */
.about-section a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.about-section a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Legal */
.about-legal {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #e5e7eb;
    margin-top: 28px;
}

.about-legal a {
    font-size: 13px;
    margin: 0 8px;
}

.copyright {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 12px;
}


.floating-copyright {
    position: fixed;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%); /* Centers the text horizontally */
    font-size: 10px;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 500;
    backdrop-filter: blur(5px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}
@media (max-width: 480px) {
    #chatMessages [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}




