body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #000;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.ui-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-bar {
    background: #ffffff;
    padding: 6px 8px 6px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 600px;
    pointer-events: auto;
    border: 2px solid #1a73e8;
    margin-bottom: 0;
}

.instructions-bar {
    border-color: #34a853;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 14px;
    color: #333;
    padding: 8px 0;
    background: transparent;
}

.input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#phrase-picker {
    border: none;
    background: #f8f9fa;
    color: #5f6368;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    max-width: 120px;
}

#phrase-picker:hover {
    background: #e8eaed;
}

#send-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

#send-btn:hover {
    background: #1557b0;
}

#send-btn:disabled {
    background: #ccc;
    cursor: wait;
}

.button-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

#draw-route-btn,
#restart-btn {
    background: #f1f3f4;
    color: #5f6368;
    border: 1px solid #dadce0;
    padding: 6px 10px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#draw-route-btn:hover,
#restart-btn:hover {
    background: #e8eaed;
    color: #202124;
}

#draw-route-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.search-icon {
    color: #777;
}

.chip-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
}

.chip {
    background: white;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: background 0.2s;
}

.chip.active {
    background: #1a73e8;
    color: white;
}



.location-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 1000;
    font-family: monospace;
}

/* Hide Leaflet controls for a cleaner look or restyle them */
.leaflet-control-attribution {
    font-size: 9px !important;
    background: rgba(255, 255, 255, 0.7) !important;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
    margin-right: 10px !important;
}

.poi-label {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.marker-blink {
    animation: marker-pulse 0.4s ease-in-out infinite alternate;
    z-index: 2000 !important;
}

@keyframes marker-pulse {
    from { 
        transform: scale(1); 
        filter: brightness(1);
    }
    to { 
        transform: scale(1.4); 
        filter: brightness(1.5) drop-shadow(0 0 12px #ffeb3b);
    }
}

.drawing-cursor {
    animation: cursor-glow 0.6s ease-in-out infinite alternate;
}

@keyframes cursor-glow {
    from {
        filter: drop-shadow(0 0 8px #ffeb3b);
    }
    to {
        filter: drop-shadow(0 0 20px #ffeb3b) brightness(1.3);
    }
}

.dialogue-container {
    position: absolute;
    bottom: 60px;
    left: 10px;
    right: 10px;
    max-width: 500px;
    max-height: 60vh;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dialogue-container.hidden {
    display: none;
}

.dialogue-header {
    background: #1a73e8;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
}

#close-dialogue {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#close-dialogue:hover {
    opacity: 0.8;
}

.dialogue-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.dialogue-message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dialogue-message.you {
    text-align: left;
}

.dialogue-message.guide {
    text-align: left;
    padding-left: 20px;
    border-left: 3px solid #34a853;
}

.dialogue-message .speaker {
    font-weight: bold;
    color: #1a73e8;
    margin-bottom: 4px;
    font-size: 13px;
}

.dialogue-message.guide .speaker {
    color: #34a853;
}

.dialogue-message .text {
    background: #f1f3f4;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.dialogue-message.guide .text {
    background: #e8f5e9;
}

/* Tourist marker styling: subtle drop shadow and crisp rendering for better visibility */
.tourist-icon {
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.45));
    -webkit-filter: drop-shadow(0 6px 12px rgba(0,0,0,0.45));
    image-rendering: optimizeQuality;
    will-change: transform;
}

/* POI photograph-style icon (small rounded thumbnail) */
.poi-photo-icon img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.45);
    border: 2px solid white;
    -webkit-user-drag: none;
    user-select: none;
    display: block;
}

/* Zoom in/out animation for revealed destination labels */
@keyframes label-zoom {
    0% { transform: scale(1); }
    50% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

.zoom-label {
    animation: label-zoom 1.2s ease-in-out infinite;
    transform-origin: center center;
    z-index: 9999 !important;
}