/* Find-a-Ride Agent — Chat Widget & Results */

.mwt-ride-agent {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

.mwt-agent-layout {
    display: flex;
    gap: 1rem;
    min-height: 500px;
    max-height: 70vh;
}

.mwt-agent-chat-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.mwt-agent-chat-header {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #ddd;
    background: #f6f7f7;
    border-radius: 8px 8px 0 0;
}

.mwt-agent-new-conversation {
    background: none;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-size: 13px;
    color: #1d2327;
    cursor: pointer;
}

.mwt-agent-new-conversation:hover {
    background: #f0f0f1;
    border-color: #646970;
}

.mwt-agent-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.mwt-message {
    margin-bottom: 1rem;
}

.mwt-message-content {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 85%;
    overflow-wrap: break-word;
    overflow: visible;
}

.mwt-message-user .mwt-message-content {
    background: #2271b1;
    color: #fff;
    margin-left: auto;
}

.mwt-message-assistant .mwt-message-content {
    background: #f0f0f1;
    color: #1d2327;
}

/* Markdown-rendered content within assistant messages */
.mwt-message-content.mwt-markdown p {
    margin: 0 0 0.5em 0;
}

.mwt-message-content.mwt-markdown p:last-child {
    margin-bottom: 0;
}

.mwt-message-content.mwt-markdown h1,
.mwt-message-content.mwt-markdown h2,
.mwt-message-content.mwt-markdown h3 {
    margin: 0.75em 0 0.35em 0;
    font-weight: 600;
    line-height: 1.3;
}

.mwt-message-content.mwt-markdown h1 { font-size: 1.15em; }
.mwt-message-content.mwt-markdown h2 { font-size: 1.05em; }
.mwt-message-content.mwt-markdown h3 { font-size: 1em; }

.mwt-message-content.mwt-markdown ul,
.mwt-message-content.mwt-markdown ol {
    margin: 0.5em 0;
    padding-left: 1.25em;
}

.mwt-message-content.mwt-markdown li {
    margin-bottom: 0.2em;
}

.mwt-message-content.mwt-markdown code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.15em 0.35em;
    border-radius: 4px;
    font-size: 0.9em;
}

.mwt-message-content.mwt-markdown pre {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    overflow-x: auto;
    max-width: 100%;
    margin: 0.5em 0;
    font-size: 0.9em;
}

.mwt-message-content.mwt-markdown pre code {
    background: none;
    padding: 0;
}

.mwt-message-content.mwt-markdown blockquote {
    margin: 0.5em 0;
    padding-left: 1em;
    border-left: 3px solid #8c8f94;
    color: #50575e;
}

.mwt-message-content.mwt-markdown hr {
    border: none;
    border-top: 1px solid #c3c4c7;
    margin: 0.75em 0;
}

.mwt-message-content.mwt-markdown a {
    color: #2271b1;
    text-decoration: underline;
}

.mwt-message-content.mwt-markdown a:hover {
    color: #135e96;
}

.mwt-message-loading .mwt-message-content {
    background: #f0f0f1;
}

.mwt-typing-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: mwt-typing 1.4s ease-in-out infinite both;
}

.mwt-typing-indicator::before,
.mwt-typing-indicator::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
}

@keyframes mwt-typing {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

.mwt-agent-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #ddd;
}

.mwt-agent-input textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    resize: none;
    font-family: inherit;
    font-size: 15px;
}

.mwt-agent-input textarea:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.mwt-agent-send {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: #2271b1;
    color: #fff;
    cursor: pointer;
}

.mwt-agent-send:hover:not(:disabled) {
    background: #135e96;
}

.mwt-agent-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mwt-agent-results-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mwt-agent-map {
    flex: 1;
    min-height: 250px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.mwt-agent-results {
    flex: 1;
    min-height: 150px;
    overflow-y: auto;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fafafa;
}

.mwt-agent-results-empty {
    color: #646970;
    font-style: italic;
    margin: 0;
}

.mwt-agent-results-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
}

.mwt-agent-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mwt-result-card {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.mwt-result-card-highlighted {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.3);
}

.mwt-result-header {
    margin-bottom: 0.25rem;
}

.mwt-result-meta {
    margin-bottom: 0.25rem;
}

.mwt-result-type,
.mwt-result-notice {
    font-size: 0.85em;
    color: #646970;
    margin-right: 0.5rem;
}

.mwt-result-phone,
.mwt-result-address,
.mwt-result-schedule {
    font-size: 0.9em;
    margin-bottom: 0.25rem;
}

.mwt-result-link a {
    color: #2271b1;
}

.mwt-result-details summary {
    cursor: pointer;
    font-size: 0.9em;
}

.mwt-result-details-content {
    margin-top: 0.5rem;
    font-size: 0.9em;
}

.mwt-agent-disabled {
    padding: 1rem;
    background: #fcf0f1;
    border-left: 4px solid #d63638;
}

@media (max-width: 782px) {
    .mwt-agent-layout {
        flex-direction: column;
        max-height: none;
    }

    .mwt-agent-map {
        min-height: 200px;
    }
}
