/* Main App States */
.main-app-hidden {
    position: fixed;
    top: -100vh;
    /* Position off-screen but still rendered */
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
}

.main-app-visible {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
}

/* Authentication Screen Styles */
.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.auth-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.auth-container h1 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 600;
}

.auth-container p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.auth-form {
    margin-bottom: 20px;
}

.token-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.token-input:focus {
    outline: none;
    border-color: #667eea;
}

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

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

.auth-button:active {
    transform: translateY(0);
}

.auth-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-error {
    background: #fee;
    color: #d00;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid #fcc;
}

.auth-error a {
    color: #0066cc;
    text-decoration: underline;
}

.auth-error a:hover {
    color: #0052a3;
    text-decoration: none;
}

.auth-help {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-help a {
    color: #667eea;
    text-decoration: none;
}

.auth-help a:hover {
    text-decoration: underline;
}

/* Terms of Service Popup Styles */
.terms-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.terms-container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.terms-container h2 {
    color: #333;
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 600;
}

.terms-intro {
    color: #666;
    margin-bottom: 24px;
    font-size: 16px;
}

.terms-form {
    margin-top: 20px;
}

.terms-checkbox-group {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    text-align: left;
}

.terms-checkbox {
    margin-right: 12px;
    margin-top: 4px;
    min-width: 18px;
    height: 18px;
    cursor: pointer;
}

.terms-label {
    color: #444;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}

.terms-label a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.terms-label a:hover {
    text-decoration: underline;
}

.terms-button {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

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

.terms-button:active:not(:disabled) {
    transform: translateY(0);
}

.terms-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.terms-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 12px;
    padding: 8px;
    background-color: #ffeee9;
    border-radius: 4px;
}

/* General body and page styles */
html,
body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

ul,
li {
    margin-top: 0;
    padding-top: 0;
}

body {
    font-family: sans-serif;
    margin: 0;
    /* background-color: #f4f4f4; */
    color: #333;
    line-height: 1.6;
    display: flex;
    /* Enable flexbox for the body */
    flex-direction: column;
    /* Stack elements vertically */
    min-height: 100vh;
    /* Ensure body takes full viewport height */
    position: absolute;
}

#chatbox {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: absolute;
    right: 0;
    top: 0;
    width: 430px;
    box-sizing: border-box;
    border-left: 1px solid #ccc;
    background-color: #fff;
    z-index: 1000;
}

/* Welcome message */
.welcome-message {
    padding: 14px 20px 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
    gap: 8px;
}

.welcome-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.welcome-disclaimer {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.95);
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.welcome-disclaimer i {
    font-style: italic;
    flex: 1;
}

.disclaimer-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: -2px;
}

.disclaimer-close:hover {
    color: rgba(255, 255, 255, 1);
    background: rgba(255, 255, 255, 0.1);
}

.disclaimer-close:active {
    background: rgba(255, 255, 255, 0.2);
}

.welcome-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.logout-button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    gap: 6px;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logout-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#chatbox-head {
    height: 54px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #334155;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #e2e8f0;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#chatbox-head svg {
    display: block;
    width: 18px;
    height: 18px;
    transition: all 0.2s ease;
}

#chatbox-head span:not(.chatbox-head-left):not(.chatbox-head-right) {
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 2px;
}

#chatbox-head span:not(.chatbox-head-left):not(.chatbox-head-right):hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.chatbox-head-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chatbox-head-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#session_list {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #334155;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    flex: 1;
    max-width: none;
}

#session_list:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#chatbox-head {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 1px solid #e2e8f0;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

#chatbox-head svg {
    display: block;
    width: 18px;
    height: 18px;
    transition: all 0.2s ease;
}

#chatbox-head span:not(.chatbox-head-left):not(.chatbox-head-right) {
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 2px;
}

#chatbox-head span:not(.chatbox-head-left):not(.chatbox-head-right):hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.chatbox-head-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chatbox-head-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#session_list {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #334155;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    flex: 1;
    max-width: none;
}

#session_list:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#session_list:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.chatbox-head-row {
    display: flex;
    align-items: center;
    height: 50px;
    gap: 12px;
    padding: 0 16px 0 12px;
    width: 100%;
    box-sizing: border-box;
}

.add-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.add-button:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.session-selector {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #334155;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    max-width: none;
}

.session-selector:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.session-selector:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.action-buttons {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.action-buttons span {
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.action-buttons span:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.preview-indicator {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 193, 7, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.session-disclaimer {
    padding: 8px 12px 12px 12px;
    color: #666;
    font-size: 12px;
    line-height: 1.4;
}

/* Chat messages container */
#messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
}

#on_going_message {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 10px;
}

/* Message styles */
.message {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    white-space: pre-line;
    /* Preserve line breaks but collapse whitespace */
    transition: all 0.2s ease;
}

.message.assistant {
    max-width: 85%;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.message.user {
    max-width: 75%;
    font-weight: 400;
}

/* List styling in messages */
.message ul {
    margin-top: 0.5em;
    padding-left: 1.5em;
}

.message li {
    margin-bottom: 0.3em;
}

.message.assistant {
    align-self: flex-start;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid transparent;
    background-clip: padding-box;
    color: white;
    box-shadow:
        0 4px 20px rgba(102, 126, 234, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.message.assistant:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(102, 126, 234, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.15);
}

.message.assistant:hover::after {
    opacity: 0.6;
}

.message.assistant::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}

.message.user {
    align-self: flex-end;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Thinking updates from the agent */
.thinking-update {
    color: #667eea;
    font-style: normal;
    font-size: 13px;
    font-weight: 500;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-left: 4px solid #667eea;
    padding: 12px 16px 12px 20px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    overflow: hidden;
    animation: slideInLeft 0.3s ease-out;
}

.thinking-update::before {
    content: '🧠';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    animation: think 2s ease-in-out infinite;
}

.thinking-update::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    animation: progress 2s ease-in-out infinite;
}

@keyframes think {
    0%,
    100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.1);
    }
}

@keyframes progress {
    0%,
    100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

@keyframes slideInLeft {
    0% {
        transform: translateX(-20px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Thinking step content styling */
.thinking-update strong {
    color: #4c1d95;
    font-weight: 600;
}

.thinking-update em {
    color: #6366f1;
    font-style: normal;
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* Active thinking step with pulsing effect */
.thinking-update.active {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    animation: pulse-green 1.5s ease-in-out infinite;
}

.thinking-update.active::before {
    content: '⚡';
    animation: electric 1s ease-in-out infinite;
}

.thinking-update.active::after {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    width: 4px;
}

@keyframes pulse-green {
    0%,
    100% {
        box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
    }
    50% {
        box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
    }
}

@keyframes electric {
    0%,
    100% {
        transform: translateY(-50%) rotate(0deg);
    }
    25% {
        transform: translateY(-50%) rotate(-5deg);
    }
    75% {
        transform: translateY(-50%) rotate(5deg);
    }
}

/* Completed thinking step */
.thinking-update.completed {
    opacity: 0.7;
    border-left-color: #6b7280;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.thinking-update.completed::before {
    content: '✅';
    animation: none;
}

.thinking-update.completed::after {
    background: #6b7280;
    animation: none;
}

/* Input area */
#input-area {
    align-items: center;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

/* Input field */
#input {
    width: 100%;
    font-size: 14px;
    border-radius: 12px;
    outline: none;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    padding: 14px 18px;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin: 0;
}

#input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

#input:focus {
    border-color: #667eea;
    box-shadow:
        0 0 0 3px rgba(102, 126, 234, 0.15),
        0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

#input:hover:not(:focus) {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

#input.error {
    border-color: #e3342f;
    box-shadow: 0 0 0 1px rgba(227, 52, 47, 0.5);
}

/* Send button */
.btn-primary {
    padding: 10px 20px;
    border: none;
    background: #429dfd;
    color: white;
    border-radius: 4px;
    /* margin-left: 10px; */
    cursor: pointer;
}

#mapbox_map {
    position: absolute;
    top: 0;
    left: 0;
    right: 400px;
    bottom: 0;
}

.loading-dots-animation {
    display: inline-flex;
    vertical-align: middle;
    align-items: center;
    justify-content: center;
    padding-left: 40px;
    padding-bottom: 8px;
}

.loading-dots-animation .loading-dot {
    background: #666;
    height: 7px;
    width: 7px;
    border-radius: 50%;
    margin: 0 3px;
    opacity: 0.7;
    animation: MakeLoadingAnimation 1.5s var(--delay) ease-in-out infinite;
}

.loading-dots-animation .loading-dot-txt {
    display: inline-block;
    vertical-align: middle;
    opacity: 0.7;
    animation: FadeOnly 1.5s var(--delay) ease-in-out infinite;
    margin-left: 10px;
}

@keyframes FadeOnly {
    0%,
    22% {
        opacity: 0.4;
    }

    44% {
        opacity: 0.2;
    }
}

@keyframes MakeLoadingAnimation {
    0%,
    44% {
        transform: translate(0px);
    }

    22% {
        opacity: 0.4;
        transform: translateY(-6px);
    }

    44% {
        opacity: 0.2;
    }
}

.dev-note {
    font-size: 12px;
    padding: 12px 16px;
    background-color: #f9fafb;
    border-top: 1px dashed #ccc;
    color: #555;
    font-family: 'Inter', monospace, sans-serif;
}

.dev-note-title {
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
}

.dev-note-line {
    margin-bottom: 8px;
}

.dev-note code {
    background-color: #eef2f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    display: inline-block;
    margin-top: 2px;
}

.chatbox-head-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbox-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbox-head-left select {
    padding: 6px 10px;
    border-radius: 6px;

    /* Clean white background */
    background-color: #ffffff;

    /* Light gray border for structure */
    border: 1px solid #d1d5db;

    /* Dark text for readability */
    color: #111827;

    font-family: 'Inter', sans-serif;
    font-size: 14px;

    /* Remove native dropdown styling */
    appearance: none;

    /* Custom dropdown arrow icon */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg fill='%236b7280' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;

    /* Space for the arrow */
    padding-right: 32px;

    cursor: pointer;

    /* Smooth transitions */
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.chatbox-head-left select:hover {
    /* Subtle background change on hover */
    background-color: #f9fafb;
    border-color: #cbd5e1;
}

.chatbox-head-left select:focus {
    /* Focus ring with Mapbox-like blue accent */
    outline: none;
    border-color: #1da1f2;
    box-shadow: 0 0 0 2px rgba(29, 161, 242, 0.2);
}

#delete_session,
#add_session,
#share_session,
#logout_session {
    padding: 15px 0;
    cursor: pointer;
}

#preview_session {
    display: none;
}

#preview_session svg,
#preview_session span {
    display: inline-block;
    color: #666;
    vertical-align: middle;
}

#preview_notice {
    display: none;
    background-color: #f5f7f9;
    color: #2e3439;
    border: 1px solid #d6dbe0;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    line-height: 1.6;
    margin-top: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background-color: #eef2f5;
    border-left: 4px solid #3b9ddd;
}

.theme-buttons {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ffffffcc;
    /* semi-transparent white */
    backdrop-filter: blur(4px);
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    z-index: 1;
    font-family: 'Inter', sans-serif;
    min-height: 32px;
}

.theme-label {
    font-size: 13px;
    color: #374151;
    margin-right: 12px;
    font-weight: 500;
    line-height: 32px;
    vertical-align: middle;
}

.theme-btn {
    background: #e6f1fd;
    border: 1px solid #fefefe;
    border: 1px solid #cbd5e1;
    color: #1e293b;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    line-height: 1;
    box-sizing: border-box;
    opacity: 0.7;
}

.theme-btn:hover {
    background: #ffffff;
    border-color: #94a3b8;
}

.theme-btn.active {
    font-weight: 600;
    opacity: 1;
}

.theme-btn:active {
    background: #cbd5e1;
}

/* Map layer toggle button specific styles */
.theme-btn .layer-icon {
    width: 16px;
    height: 16px;
    transition: opacity 0.2s ease;
}

/* Ensure icons are visible with proper fill colors */
.theme-btn .layer-icon path {
    fill: inherit;
    stroke: #ffffff;
    stroke-width: 0.5px;
}

.layer-toggle-text {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.mapboxgl-popup {
    max-width: 400px;
    font:
        12px/20px 'Helvetica Neue',
        Arial,
        Helvetica,
        sans-serif;
}

.mapboxgl-popup-context {
    font-family: sans-serif;
    min-width: 200px;
}

.mapboxgl-popup-context .title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 4px;
}

.mapboxgl-popup-context .description {
    font-size: 14px;
    color: #555;
}

.message-box {
    display: flex;
    /* flex-direction: column; */
    gap: 8px;
}

.message-box.user {
    justify-content: flex-end;
    /* flex-direction: row-reverse; */
}

.message-box.assistant {
    justify-content: flex-start;
}

.thinking-steps {
    display: inline-block;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f1f5f9;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #64748b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-left: 40px;
    margin-bottom: 12px;
    position: relative;
    transition: all 0.2s ease;
}

.thinking-steps:hover {
    border-color: #94a3b8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.thinking-steps ul {
    list-style: none;
    padding-left: 0;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.thinking-steps-title {
    cursor: pointer;
    font-weight: 500;
    color: #475569;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.thinking-steps-title:hover {
    color: #334155;
}

.thinking-steps-title::before {
    content: '▶';
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.2s ease;
    margin-right: 6px;
}

.thinking-steps.expanded .thinking-steps-title::before {
    transform: rotate(90deg);
}

.thinking-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    padding: 6px 10px 6px 20px;
    position: relative;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    border-left: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.thinking-step:hover {
    background: rgba(255, 255, 255, 0.9);
    border-left-color: #94a3b8;
}

.thinking-step::before {
    content: '◦';
    color: #94a3b8;
    position: absolute;
    left: 8px;
    top: 8px;
    font-size: 12px;
    font-weight: bold;
}

.thinking-step-text {
    font-size: 12px;
    line-height: 1.5;
    color: #334155;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

.conversation {
    width: 100%;
    /* padding-bottom: 20px; */
}

.feedback-trigger {
    display: none;
    position: absolute;
    right: 10px;
    bottom: 90px;
    cursor: pointer;
}

.feedback {
    display: none;
    position: absolute;
    right: 10px;
    bottom: 80px;
    width: 240px;
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    padding-top: 5px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-family: 'Helvetica Neue', sans-serif;
}

.feedback-title {
    font-size: 15px;
    color: #333;
    margin: 5px 0;
    margin-bottom: 8px;
}

.feedback-btn {
    display: inline-block;
    background-color: #4264fb;
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin-top: 5px;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.feedback-btn:hover {
    background-color: #3b57e3;
}

.feedback-close {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 16px;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
}

.feedback-close:hover {
    color: #666;
}

@media (max-width: 768px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    body {
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
        position: fixed;
        width: 100%;
        top: 0;
        left: 0;
    }

    #mapbox_map {
        position: relative;
        right: 0;
        height: 50vh;
        height: 50dvh;
        width: 100%;
        flex-shrink: 0;
    }

    #chatbox {
        position: relative;
        width: 100%;
        height: 50vh;
        height: 50dvh;
        max-height: 50vh;
        max-height: 50dvh;
        right: 0;
        top: 0;
        border-left: none;
        border-top: 1px solid #ccc;
        flex-shrink: 0;
    }

    .theme-buttons {
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 1001;
    }

    #input {
        font-size: 16px;
    }

    .feedback-trigger {
        right: 5px;
        bottom: calc(50vh + 20px);
        background-color: white;
        border-radius: 50%;
        padding: 6px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .feedback {
        right: 5px;
        bottom: calc(50vh + 20px);
    }
}
