/* AI Panel Styles - Glassmorphism & Cyber Aesthetics */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --glass-bg: #000000;
    /* Solid black base */
    --glass-border: #1a1a1a;
    /* Subtle dark border */
    --neon-blue: #333333;
    /* Used for user bubbles / accents now */
    --neon-purple: #bd00ff;
    --text-primary: #eaeaea;
    --text-secondary: #888888;
}

#ai-overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    pointer-events: none;
    /* Let clicks pass through to Globe */
    z-index: 10002;
}

/* Hero Overlay (Left Aligned & Smaller) */
#hero-overlay {
    position: absolute;
    top: 42%;
    left: 8%;
    /* Lowered from 32% */
    transform: translateY(-50%);
    /* Only center vertically */
    text-align: left;
    pointer-events: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* Align contents to left */
    gap: 10px;
    /* Reduced gap */
    animation: fadeInUp 1s ease-out;
    max-width: 500px;
    /* Limit width */
}

.hero-logo {
    width: 220px; /* Reduced size */
    height: auto;
    object-fit: contain;
    /* Overlap the button into the transparent padding area */
    margin-bottom: -90px; 
    margin-left: -18px; 
    filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.4));
    animation: fadeInUp 1.2s ease-out;
}






.hero-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--neon-blue);
    color: white;
    padding: 10px 20px;
    /* Reduced padding */
    font-size: 1rem;
    /* Reduced from 1.2rem */
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: -15px; /* Moved slightly more to the left */
}



.hero-btn:hover {
    background: var(--neon-blue);
    color: black;
    transform: scale(1.05);
    box-shadow: 0 0 30px var(--neon-blue);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.ai-panel {
    position: absolute;
    background: #000000;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    max-height: 80vh;
}

/* Local Guide Panel */
#info-panel {
    top: 100px;
    right: 20px;
    width: 350px;
    height: 500px;
}

/* Trip Planner Panel */
#planner-panel {
    top: 100px;
    right: 20px;
    left: auto;
    width: 400px;
    height: 600px;
}

/* Maximized/Minimized states removed as per user request */

/* Resize Handle (Moved to Top-Left) */
.resize-handle {
    position: absolute;
    top: 0;
    /* Move to Top */
    left: 0;
    /* Move to Left */
    right: auto;
    bottom: auto;
    width: 20px;
    height: 20px;
    /* Gradient direction changed for top-left visual */
    background: linear-gradient(135deg, var(--neon-blue) 50%, transparent 50%);
    cursor: nwse-resize;
    opacity: 0.5;
    transition: 0.2s;
    border-top-left-radius: 16px;
    /* Match panel corner */
    border-bottom-right-radius: 0;
    z-index: 100;
    /* Ensure clickable */
}

.resize-handle:hover {
    opacity: 1;
}

/* Minimized state removed */

.ai-panel.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

/* Header */
.panel-header {
    padding: 15px 20px;
    background: transparent;
    border-bottom: 1px solid #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative; /* FIX: required for z-index to take effect */
    z-index: 101;
}

.panel-header span {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 4px;
    transition: 0.2s;
    pointer-events: auto; /* FIX: explicitly ensure buttons receive click events */
    position: relative;   /* FIX: ensure button sits in its own stacking context */
    z-index: 102;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Chat Area */
.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Messages */
.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.message.bot {
    background: #1a1a1a;
    color: #eaeaea;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

/* Ensure headings and bold text inside bot messages are readable */
.message.bot b, 
.message.bot strong {
    color: #90E0EF; /* Lite Blue for emphasis */
    font-weight: 700;
}

.message.bot h1, 
.message.bot h2, 
.message.bot h3, 
.message.bot h4 {
    color: #ffffff;
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 1.1rem;
    font-family: 'Space Grotesk', sans-serif;
}

.message.user {
    background: #2a2a2a;
    color: #eaeaea;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input Area */
.panel-input-area {
    padding: 15px;
    background: transparent;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.panel-input-area input {
    flex: 1;
    background: transparent;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 10px 15px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: 0.3s;
}

.ghost-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
}

.ghost-input-wrapper input {
    width: 100%;
}

.ghost-input {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    color: rgba(255, 255, 255, 0.3) !important;
    pointer-events: none;
    background-color: transparent !important;
}

.panel-input-area input:not(.ghost-input) {
    z-index: 2;
    background-color: transparent !important;
}

.panel-input-area input:focus {
    border-color: #555;
}

.panel-input-area button {
    background: #1a1a1a;
    border: 1px solid #333;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-input-area button:hover {
    background: #2a2a2a;
}

.panel-input-area button:disabled {
    background: #111;
    border-color: #222;
    color: #555;
    cursor: not-allowed;
}

/* Status Bar */
.connection-status {
    padding: 8px 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
}

#status-dot,
#planner-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    transition: 0.3s;
}

.status-online {
    background: #00ff88 !important;
    box-shadow: 0 0 8px #00ff88;
}

.status-offline {
    background: #ff4444 !important;
}

/* NEW: Thinking Status */
.status-thinking {
    background: #ffaa00 !important;
    box-shadow: 0 0 10px #ffaa00;
    animation: breathe 1.5s infinite ease-in-out;
}

@keyframes breathe {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Action Buttons in Chat (Destination Suggestions) */
.planner-action-btn {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #eaeaea;
    padding: 8px 16px;
    border-radius: 20px;
    margin-top: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-family: inherit;
    font-weight: 500;
    margin-right: 8px;
}

.planner-action-btn:hover {
    background: #2a2a2a;
    border-color: #555;
    color: #ffffff;
}

/* Mobile Responsive */
@media (max-width: 768px) {

    #info-panel,
    #planner-panel,
    #detailed-itinerary-widget {
        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        transform: none !important;
        margin: 0 !important;
        box-shadow: none !important;
    }

    .chat-content {
        padding: 15px;
        gap: 12px;
    }

    .panel-input-area {
        padding: 10px 15px 5px 15px;
    }

    .connection-status {
        padding: 5px 20px 20px 20px;
        padding-bottom: calc(env(safe-area-inset-bottom, 10px) + 12px) !important;
    }

    #info-panel.minimized,
    #planner-panel.minimized {
        height: 60px !important;
        bottom: 0 !important;
        top: auto !important;
        border-radius: 12px 12px 0 0 !important;
    }

    /* Optimized Maximized State for Mobile */
    .ai-panel.maximized {
        width: 100% !important;
        height: 100% !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
        max-height: 100vh !important;
    }

    /* Hide the floating bubble on mobile to clear the input area */
    #itinerary-restore-btn {
        display: none !important;
    }

    /* Show the header-integrated itinerary link on mobile */
    #planner-itinerary-btn:not(.hidden) {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(0, 255, 166, 0.1);
        border: 1px solid rgba(0, 255, 166, 0.3);
        border-radius: 8px;
        margin-right: 5px;
        animation: pulse-green 2s infinite;
    }

    @keyframes pulse-green {
        0% { box-shadow: 0 0 0 0 rgba(0, 255, 166, 0.4); }
        70% { box-shadow: 0 0 0 6px rgba(0, 255, 166, 0); }
        100% { box-shadow: 0 0 0 0 rgba(0, 255, 166, 0); }
    }

    /* Hero Overlay Mobile Positioning (Moves it higher above the globe) */
    #hero-overlay {
        top: 20% !important;
        left: 10% !important;
    }

    .hero-logo {
        width: 180px !important;
        margin-bottom: -75px !important;
    }

    .hero-btn {
        font-size: 0.9rem !important;
        padding: 8px 16px !important;
    }
}

/* =========================================
   NEW: FORM OVERLAY STYLES
   ========================================= */

.form-overlay {
    position: absolute;
    top: 45px;
    /* Below header */
    left: 0;
    width: 100%;
    height: calc(100% - 45px);
    /* Full height minus header */
    background: #000000;
    /* Updated to match black modern UI */
    backdrop-filter: blur(15px);
    z-index: 20;
    padding: 20px;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.form-overlay.hidden {
    display: none;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.form-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--neon-blue);
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: white;
}

.form-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding-right: 5px;
    /* Space for scrollbar */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* Inputs & Selects */
textarea,
select,
input[type="number"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: 0.3s;
    width: 100%;
}

textarea {
    resize: none;
    height: 80px;
}

textarea:focus,
select:focus,
input:focus {
    border-color: var(--neon-blue);
    background: rgba(255, 255, 255, 0.1);
}

/* Dropdown Options (Dark) */
select option {
    background: #0f172a;
    color: white;
}

/* Submit Button */
.submit-btn {
    margin-top: 10px;
    background: linear-gradient(135deg, var(--neon-blue), #2563eb);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}


/* 
=========================================
   NEW: SALES MODE STYLES (Suggest Package)
========================================= 
*/

.sparkle-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
    /* Gold tint */
    color: #ffd700;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
    animation: pulse-gold 3s infinite;
}

.sparkle-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    transform: translateY(-1px);
}

@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 215, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    }
}

/* 
=========================================
   INDIA LOCAL TRIP BADGE — Pinned above input
========================================= 
*/

.local-trip-badge-container {
    padding: 10px 14px 6px;
    display: flex;
    justify-content: center;
    animation: slideUpFade 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    flex-shrink: 0;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.local-trip-btn {
    background: linear-gradient(135deg, rgba(255, 153, 0, 0.12), rgba(19, 136, 8, 0.12));
    border: 1px solid rgba(255, 153, 0, 0.65);
    color: #ffaa33;
    padding: 9px 20px;
    border-radius: 24px;
    font-size: 0.88rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.4px;
    transition: all 0.3s ease;
    animation: pulse-india 2.2s infinite;
    box-shadow: 0 0 14px rgba(255, 153, 0, 0.22);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.local-trip-btn:hover {
    background: rgba(255, 153, 0, 0.22);
    box-shadow: 0 0 28px rgba(255, 153, 0, 0.5), 0 0 5px rgba(19, 136, 8, 0.3);
    transform: translateY(-2px);
    color: #ffc055;
    border-color: rgba(255, 153, 0, 0.9);
}

@keyframes pulse-india {
    0%   { box-shadow: 0 0 0 0   rgba(255, 153, 0, 0.55); }
    70%  { box-shadow: 0 0 0 12px rgba(255, 153, 0, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(255, 153, 0, 0);    }
}

/* Sales Mode Chat Styling */
.sales-mode-active {
    border: 1px solid rgba(255, 215, 0, 0.5) !important;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.1) !important;
}

.message.sales-agent {
    background: rgba(40, 30, 10, 0.6);
    border-left: 3px solid #ffd700;
    color: #fff;
}

.package-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
}

.package-card h4 {
    color: #ffd700;
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.package-card p {
    font-size: 0.9rem;
    color: #ddd;
    margin: 0 0 10px 0;
}

.book-now-btn {
    background: #ffd700;
    color: #000;
    border: none;
    padding: 5px 15px;
    border-radius: 15px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
    width: 100%;
}

.book-now-btn:hover {
    background: #ffed4a;
    transform: scale(1.02);
}

/* 
=========================================
   NEW: VOICE INPUT STYLES (STT)
========================================= 
*/

.mic-btn {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-secondary) !important;
    font-size: 1rem;
    transition: all 0.3s ease !important;
}

.mic-btn:hover {
    color: var(--neon-blue) !important;
    border-color: var(--neon-blue) !important;
    background: rgba(0, 212, 255, 0.1) !important;
    transform: scale(1.05) !important;
}

.mic-listening {
    color: #ff2e63 !important;
    border-color: #ff2e63 !important;
    background: rgba(255, 46, 99, 0.15) !important;
    animation: mic-pulse 1.5s infinite !important;
    transform: scale(1.1) !important;
}

@keyframes mic-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 46, 99, 0.5);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 46, 99, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 46, 99, 0);
    }
}

/* Audio Visualizer / Waveform */
#audio-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 20px;
    margin-right: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    /* Don't block clicks */
}

#audio-visualizer.active {
    opacity: 1;
}

.bar {
    width: 3px;
    height: 3px;
    /* Default height */
    background: #ff2e63;
    border-radius: 3px;
    background: linear-gradient(to top, #ff2e63, #bd00ff);
    transition: height 0.05s ease;
}

/* 
=========================================
   NEW: DETAILED ITINERARY WIDGET
========================================= 
*/

#detailed-itinerary-widget {
    top: 50px;
    left: 20px;
    right: auto;
    width: 750px; /* Reduced from 850px to minimize overlap */
    height: 700px; /* Slightly shorter */
    max-height: 85vh;
    border: 1px solid rgba(19, 106, 138, 0.4);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 2100;
    /* Above planner */
}

/* Itinerary Layout Responsive */
@media (max-width: 768px) {
    .itinerary-layout {
        flex-direction: column !important;
    }

    .itinerary-timeline,
    .itinerary-map-container {
        width: 100% !important;
        height: 50% !important;
    }
}

.itinerary-layout {
    display: flex;
    flex-direction: row;
    height: calc(100% - 46px);
    /* 100% minus header height */
    width: 100%;
    background: #000000;
}

.itinerary-timeline {
    width: 40%;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    scrollbar-width: thin;
    scrollbar-color: var(--neon-blue) transparent;
}

.timeline-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--neon-blue);
    font-size: 0.9rem;
    gap: 15px;
}

.itinerary-map-container {
    width: 60%;
    height: 100%;
    position: relative;
}

#itinerary-map {
    width: 100%;
    height: 100%;
    background-color: #242424;
    /* Map baseline load dark */
    z-index: 10;
}

/* Timeline Custom Nodes */
.timeline-item {
    display: flex;
    position: relative;
    padding-bottom: 25px;
}

/* The dotted line */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 11px;
    /* Center of the 24px circle */
    top: 24px;
    bottom: 0;
    width: 2px;
    background: repeating-linear-gradient(to bottom,
            rgba(0, 212, 255, 0.5) 0,
            rgba(0, 212, 255, 0.5) 4px,
            transparent 4px,
            transparent 8px);
    z-index: 1;
}

/* Remove line from last element */
.timeline-item:last-child::before {
    display: none;
}

.timeline-marker {
    position: relative;
    z-index: 2;
    margin-right: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2px;
}

.timeline-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid var(--neon-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.timeline-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    transition: transform 0.2s, background 0.2s;
}

.timeline-content:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
    border-color: rgba(0, 212, 255, 0.3);
}

.timeline-title {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    margin: 0 0 5px 0;
}

.timeline-duration {
    font-size: 0.75rem;
    color: #4ade80;
    /* Green tint */
    margin: 0 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.timeline-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.wikipedia-attribution {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 5px;
    display: block;
    font-style: italic;
}

.timeline-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    /* Hidden until loaded */
}

/* MapLibre Popup overrides for Glassmorphism */
.maplibregl-popup-content {
    background: rgba(15, 23, 42, 0.95) !important;
    color: white !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--neon-blue);
    border-radius: 12px !important;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5) !important;
    padding: 15px !important;
    font-family: inherit;
}

.maplibregl-popup-tip {
    border-top-color: var(--neon-blue) !important;
}

.itinerary-day-header {
    color: var(--electric-blue);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(0, 194, 255, 0.2);
    padding-bottom: 5px;
    font-weight: 700;
}

.wiki-snippet {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
    line-height: 1.4;
    transition: 0.3s;
}

.wiki-snippet em {
    font-style: italic;
    opacity: 0.9;
}

/* Timeline Custom Nodes */
.timeline-node {
    display: flex;
    position: relative;
    padding-bottom: 25px;
}

.timeline-node::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: repeating-linear-gradient(to bottom,
            rgba(0, 212, 255, 0.5) 0,
            rgba(0, 212, 255, 0.5) 4px,
            transparent 4px,
            transparent 8px);
    z-index: 1;
}

.timeline-node:last-child::before {
    display: none;
}

.timeline-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid var(--neon-blue);
    margin-right: 15px;
    z-index: 2;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid var(--neon-blue);
    /* Remove default tip shadow/border mix */
}

.leaflet-popup-content h4 {
    margin: 0 0 5px 0;
    color: var(--neon-blue);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
}

.leaflet-popup-content p {
    margin: 0;
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
}

/* 
=========================================
   PHASE 2 — KOCHI LOCAL EXPLORER (FULL SCREEN)
=========================================
*/
/* Full viewport overlay */
.kochi-explorer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0a0a;
    z-index: 20000; /* Boosted to stay above global nav */
    display: flex;
    flex-direction: column;
    font-family: 'Outfit', sans-serif;
    transform: translateY(calc(100% + 100px));
    transition: transform 0.5s cubic-bezier(0.34, 1.20, 0.64, 1);
    pointer-events: none;
    visibility: hidden;
}

.kochi-explorer-overlay.kochi-explorer-visible {
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

/* Header bar */
.kochi-explorer-header {
    height: 64px; /* Increased slightly for better spacing */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: #050505;
    border-bottom: 1px solid rgba(0, 255, 166, 0.15);
    flex-shrink: 0;
}

.kochi-explorer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0; /* Allow shrinking */
}

.kochi-brand-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #00FFA6;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kochi-brand-coords {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kochi-back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.kochi-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Split body */
.kochi-explorer-body {
    flex: 1;
    display: flex;
    min-height: 0; /* Important for flex children scrolling */
}

/* Left sidebar */
.kochi-explorer-sidebar {
    width: 420px;
    background: #0d0d0d;
    border-right: 1px solid rgba(0, 255, 166, 0.15);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.kochi-sidebar-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: #00FFA6 transparent;
}

.kochi-sidebar-messages p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    line-height: 1.5;
}

.kochi-sidebar-messages strong {
    color: #00FFA6;
}

/* Budget Toggle Styles */
.kochi-budget-container {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.budget-btn {
    flex: 1;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
}

.budget-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.budget-btn.active {
    background: rgba(0, 255, 166, 0.12);
    border-color: #00FFA6;
    color: #00FFA6;
    box-shadow: 0 0 15px rgba(0, 255, 166, 0.1);
}

/* Action Buttons for Chat Flow */
.chat-action-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.action-btn {
    width: 100%;
    padding: 10px;
    background: rgba(0, 255, 166, 0.1);
    border: 1px solid rgba(0, 255, 166, 0.3);
    border-radius: 12px;
    color: #00FFA6;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.action-btn:hover {
    background: rgba(0, 255, 166, 0.2);
    transform: translateX(5px);
}

.action-btn i {
    margin-right: 8px;
}

/* Chat input area at bottom of sidebar */
.kochi-sidebar-input-area {
    padding: 16px 18px;
    background: #050505;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    display: flex;
    gap: 10px;
}

.kochi-sidebar-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 11px 18px;
    color: white;
    font-size: 0.92rem;
    outline: none;
    transition: all 0.2s ease;
}

.kochi-sidebar-input-area input:focus {
    border-color: #00FFA6;
    background: rgba(0, 255, 166, 0.05);
    box-shadow: 0 0 12px rgba(0, 255, 166, 0.12);
}

.kochi-sidebar-input-area button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #00FFA6;
    border: none;
    color: #000;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.kochi-sidebar-input-area button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 166, 0.4);
}

.kochi-sidebar-input-area button:active {
    transform: scale(0.95);
}

/* Right map wrapper */
.kochi-explorer-map-wrap {
    flex: 1;
    position: relative;
    background: #111; /* fallback while loading */
}

/* Map fills wrapper absolutely to guarantee sizing */
#kochi-local-map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* Mobile responsive fixes */
@media (max-width: 768px) {
    .kochi-explorer-header {
        padding: 0 12px;
        height: 60px;
    }
    
    .kochi-brand-title {
        font-size: 0.9rem;
    }
    
    .kochi-brand-coords {
        font-size: 0.65rem;
    }
    
    .kochi-back-btn {
        display: none; /* Hide for mobile as requested to declutter header */
    }

    .kochi-explorer-body {
        flex-direction: column-reverse; /* Map on top, chat on bottom */
    }
    
    .kochi-explorer-sidebar {
        width: 100%;
        height: 45%; /* Slightly more space for chat */
        border-right: none;
        border-top: 1px solid rgba(0, 255, 166, 0.15);
    }
    
    .kochi-explorer-map-wrap {
        height: 55%;
        flex: none;
    }
    
    .kochi-sidebar-messages {
        padding: 15px;
    }
    
    .budget-btn {
        padding: 8px 10px;
        font-size: 0.65rem;
        letter-spacing: 0.5px;
    }
    
    .kochi-sidebar-input-area {
        padding: 12px 15px;
    }
    
    #booking-controls {
        bottom: 12px !important;
        width: 90% !important;
    }
    
    #send-whatsapp-btn {
        padding: 10px 20px !important;
        font-size: 0.85rem !important;
        width: 100%;
        justify-content: center;
    }
}

/* Pulsing Location Marker (Unchanged) */
.kochi-user-pin {
    position: relative;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kochi-pin-dot {
    width: 12px; height: 12px;
    background: #00FFA6;
    border: 2px solid #fff;
    border-radius: 50%;
    position: relative; z-index: 2;
    box-shadow: 0 0 8px rgba(0, 255, 166, 0.8);
}
.kochi-pin-pulse {
    position: absolute;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: rgba(0, 255, 166, 0.25);
    animation: kochiPinPulse 2s ease-out infinite;
    top: 0; left: 0;
}
@keyframes kochiPinPulse {
    0%   { transform: scale(0.3); opacity: 1; }
    70%  { transform: scale(1);   opacity: 0; }
    100% { transform: scale(1);   opacity: 0; }
}

/* =========================================
   KOCHI SLOT CHAT — CHIP BUTTONS
   ========================================= */

.kochi-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.kochi-chip {
    background: rgba(0, 255, 166, 0.08);
    border: 1px solid rgba(0, 255, 166, 0.35);
    color: #00FFA6;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.kochi-chip:hover {
    background: rgba(0, 255, 166, 0.20);
    border-color: #00FFA6;
    transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(0, 255, 166, 0.25);
}

.kochi-chip:active {
    transform: translateY(0);
}

/* =========================================
   SEND TO DRIVER BUTTON — States
   ========================================= */

/* DISABLED (default): monochrome / locked */
#send-whatsapp-btn:disabled {
    background: linear-gradient(135deg, #3a3a3a 0%, #1e1e1e 100%);
    color: rgba(255, 255, 255, 0.35);
    cursor: not-allowed;
    box-shadow: none;
    filter: grayscale(1);
    opacity: 0.7;
}

/* ENABLED (itinerary ready): full green */
#send-whatsapp-btn:not(:disabled) {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    filter: grayscale(0);
    opacity: 1;
    animation: wa-btn-appear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

#send-whatsapp-btn:not(:disabled):hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 8px 28px rgba(37, 211, 102, 0.55);
}

#send-whatsapp-btn:not(:disabled):active {
    transform: translateY(0) scale(0.98);
}

@keyframes wa-btn-appear {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* Floating Restore Button Styles */
.floating-restore-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid #00FFA6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10005;
    box-shadow: 0 0 20px rgba(0, 255, 166, 0.3), inset 0 0 10px rgba(0, 255, 166, 0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    animation: floating-bounce 3s infinite ease-in-out;
}

.floating-restore-btn:hover {
    transform: scale(1.1) translateY(-8px);
    background: #000;
    border-color: #ffffff;
    box-shadow: 0 0 35px rgba(0, 255, 166, 0.7);
}

.floating-restore-btn.hidden {
    opacity: 0;
    transform: scale(0.5) translateY(50px);
    pointer-events: none;
}

.floating-restore-btn span {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.5));
}

/* 
+=========================================
+   PRINT OPTIMIZATION
+   ========================================= 
+*/
+@media print {
+    /* Hide everything except the itinerary widget */
+    body * {
+        visibility: hidden !important;
+    }
+
+    #detailed-itinerary-widget, 
+    #detailed-itinerary-widget * {
+        visibility: visible !important;
+    }
+
+    #detailed-itinerary-widget {
+        position: absolute !important;
+        left: 0 !important;
+        top: 0 !important;
+        width: 100% !important;
+        height: auto !important;
+        max-height: none !important;
+        border: none !important;
+        box-shadow: none !important;
+        background: white !important;
+        color: black !important;
+        display: block !important;
+    }
+
+    .panel-header {
+        background: white !important;
+        color: black !important;
+        border-bottom: 2px solid #333 !important;
+    }
+
+    .panel-controls {
+        display: none !important; /* Hide print/close buttons while printing */
+    }
+
+    .itinerary-layout {
+        display: block !important; /* Stack map and timeline */
+        height: auto !important;
+        background: white !important;
+    }
+
+    .itinerary-timeline {
+        width: 100% !important;
+        height: auto !important;
+        border-right: none !important;
+        overflow: visible !important;
+        padding: 0 !important;
+    }
+
+    .itinerary-map-container {
+        width: 100% !important;
+        height: 400px !important;
+        margin-top: 20px !important;
+        page-break-before: always;
+    }
+
+    .timeline-node {
+        page-break-inside: avoid;
+    }
+
+    .timeline-content {
+        background: white !important;
+        border: 1px solid #ddd !important;
+        color: black !important;
+    }
+
+    .timeline-title, .itinerary-day-header, .activity {
+        color: #000 !important;
+    }
+
+    .wiki-snippet, .location {
+        color: #444 !important;
+    }
+
+    .itinerary-top-gallery {
+        display: none !important; /* Gallery usually prints poorly */
+    }
+    
+    .floating-restore-btn, .navbar, #hero-overlay, .top-right-branding {
+        display: none !important;
+    }
+}

 @keyframes floating-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}


/* --- Itinerary Widget: Google Maps Integration --- */
.day-route-btn {
    display: inline-flex;
    align-items: center;
    margin: 5px 0 20px 0;
    font-size: 0.8rem;
    color: #eaeaea !important;
    text-decoration: none;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.15), rgba(52, 168, 83, 0.15));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 18px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.day-route-btn i {
    font-size: 1rem;
    margin-right: 10px;
    color: #00FFA6;
    transition: transform 0.3s ease;
}

.day-route-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.25), rgba(52, 168, 83, 0.25));
    border-color: #00FFA6;
    color: #fff !important;
    box-shadow: 0 8px 25px rgba(0, 255, 166, 0.25);
}

.day-route-btn:hover i {
    transform: scale(1.2) rotate(-5deg);
    color: #fff !important;
}

.location a.maps-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(0, 255, 166, 0.1);
    border: 1px solid rgba(0, 255, 166, 0.3);
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    transition: all 0.2s ease;
    color: #00FFA6 !important;
}

.location a.maps-link:hover {
    background: rgba(0, 255, 166, 0.2);
    border-color: #00FFA6;
    transform: translateY(-1px) scale(1.1);
    box-shadow: 0 0 8px rgba(0, 255, 166, 0.4);
}

.location a.maps-link i {
    font-size: 0.7rem;
}