/* RoomRite AI chat — minimal text UI */

.ai-chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1080;
    font-family: inherit;
}

.ai-chat-fab {
    background: #FF6333;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px 20px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.ai-chat-panel {
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FF6333;
    color: #fff;
    padding: 10px 14px;
}

.ai-chat-title { font-weight: 600; line-height: 1.1; }
.ai-chat-subtitle { display: block; font-weight: 400; font-size: 11px; opacity: 0.8; }

.ai-chat-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-chat-expand {
    color: #fff;
    text-decoration: underline;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.95;
    white-space: nowrap;
}

.ai-chat-expand:hover { color: #fff; opacity: 1; }

.ai-chat-action-btn {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    cursor: pointer;
    white-space: nowrap;
}

.ai-chat-action-btn:hover { background: rgba(255, 255, 255, 0.3); }

/* Full-page header with New search button */
.ai-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.ai-page-new {
    flex-shrink: 0;
    background: #fff;
    color: #FF6333;
    border: 1px solid #FF6333;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 14px;
    cursor: pointer;
    white-space: nowrap;
}

.ai-page-new:hover { background: #FF6333; color: #fff; }

.ai-chat-min {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

/* Shared chat container (widget + full page) */
.ai-chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f7f8fa;
}

.ai-msg {
    max-width: 85%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ai-msg-user {
    align-self: flex-end;
    background: #FF6333;
    color: #fff;
    border-bottom-right-radius: 3px;
}

.ai-msg-assistant {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    border-bottom-left-radius: 3px;
}

.ai-msg-error {
    align-self: flex-start;
    background: #fdecea;
    border: 1px solid #f5c2c0;
    color: #b42318;
}

/* Hotel / room cards */
.ai-cards {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 12px;
}

.ai-card-name { font-weight: 600; font-size: 14px; color: #111827; }

.ai-card-tag {
    font-size: 11px;
    font-weight: 600;
    color: #FF6333;
    border: 1px solid #ffc7b3;
    border-radius: 6px;
    padding: 1px 6px;
    margin-left: 4px;
}

.ai-card-meta { font-size: 13px; color: #6b7280; margin-top: 2px; }

.ai-card-link,
.ai-room-book {
    display: inline-block;
    margin-top: 8px;
    background: #FF6333;
    color: #fff !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
}

.ai-room {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px 12px;
}

.ai-room-name { font-size: 14px; color: #111827; }
.ai-room-book { margin-top: 0; }

/* Input */
.ai-chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.ai-chat-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    outline: none;
}

.ai-chat-input:focus { border-color: #FF6333; }

.ai-chat-send {
    background: #FF6333;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-weight: 600;
    cursor: pointer;
}

.ai-chat-send:disabled,
.ai-chat-input:disabled { opacity: 0.6; cursor: not-allowed; }

/* Typing indicator */
.ai-typing { display: inline-flex; gap: 4px; align-items: center; }
.ai-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    display: inline-block;
    animation: ai-bounce 1.2s infinite ease-in-out;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ai-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* Full-page variant */
.ai-page-wrap {
    max-width: 760px;
    margin: 0 auto;
    /* Top padding clears the fixed-top navbar; refined by JS on the page. */
    padding: 90px 16px 30px;
}

.ai-page-title { font-size: 26px; font-weight: 700; margin-bottom: 4px; }
.ai-page-sub { color: #6b7280; margin-bottom: 16px; }

.ai-chat-page {
    height: 70vh;
    min-height: 460px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
