/* Chatbot Page - Light theme - نفس شكل التطبيق */
.chatbot-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--gsp-bg);
}

.chatbot-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    min-width: 0;
    padding: 0.75rem;
    overflow: hidden;
    gap: 0.5rem;
    box-sizing: border-box;
}

.chatbot-header {
    text-align: center;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--gsp-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.chatbot-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e87a4f;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chatbot-subtitle {
    color: #52525b;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 0;
}

.quick-prompts {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.75rem;
}

.quick-prompt {
    padding: 6px 12px;
    background: rgba(232, 122, 79, 0.1);
    border: 1px solid rgba(232, 122, 79, 0.25);
    border-radius: 20px;
    color: #1a1a1a;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-prompt:hover {
    background: linear-gradient(135deg, #e87a4f, #c96a42);
    color: white;
    border-color: transparent;
}

/* Pills always visible: flex, horizontal scroll on mobile, hide scrollbar */
.quick-prompts {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.quick-prompts::-webkit-scrollbar {
    display: none;
}
@media (max-width: 768px) {
    .chatbot-header .quick-prompts {
        justify-content: flex-start;
        padding-bottom: 4px;
    }
}

.chat-container {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--gsp-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    max-width: 100%;
}

.chat-input-container {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0));
    background: #f0f2f5;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scroll-behavior: smooth;
    min-height: 0;
    background: #efeae2;
    direction: ltr;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

/* WhatsApp-style message rows */
.user-message {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.25rem;
}
.user-message .message-wrapper {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.bot-message .message-wrapper {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.message-bubble {
    word-wrap: break-word;
    line-height: 1.5;
    max-width: 100%;
    position: relative;
}

/* Sent (user) - WhatsApp green, tail bottom-right */
.user-bubble {
    background: #D9FDD3;
    color: #111b21;
    margin-left: auto;
    border-radius: 12px 12px 4px 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* Received (bot) - light grey/white, tail bottom-left */
.bot-bubble {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: #111b21;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    border-radius: 12px 12px 12px 4px;
}

/* Timestamp under bubble (WhatsApp-style) */
.message-time {
    font-size: 0.65rem;
    color: #667781;
    margin-top: 2px;
    padding: 0 4px;
}

.typing-dots {
    display: flex;
    gap: 5px;
    padding: 4px 0;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #e87a4f;
    animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

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


.chat-input-box {
    display: flex;
    gap: 8px;
    padding: 8px 8px 8px 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.chat-input-box:focus-within {
    border-color: #25D366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
}

.chat-input-field {
    flex: 1;
    background: transparent;
    border: none;
    color: #1a1a1a;
    font-size: 0.9rem;
    padding: 6px 0;
    font-family: inherit;
}

.chat-input-field:focus { outline: none; }
.chat-input-field::placeholder { color: #71717a; }

.voice-btn, .send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.voice-btn {
    background: rgba(232, 122, 79, 0.15);
    color: #e87a4f;
}

.voice-btn:hover {
    background: rgba(232, 122, 79, 0.25);
}

.voice-btn.recording {
    background: #EF4444;
    color: white;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.send-btn {
    background: #25D366;
    color: white;
}

.send-btn:hover {
    background: #20bd5a;
    transform: scale(1.05);
}

.chat-hint {
    text-align: center;
    font-size: 0.7rem;
    color: #71717a;
    margin-top: 6px;
}

/* Pills: always visible on mobile – horizontal scroll, no hide */
@media (max-width: 768px) {
    .chatbot-main { padding: 0.5rem; }
    .chatbot-header { padding: 0.5rem 0.75rem; }
    .chatbot-title { font-size: 1rem; }
    .chatbot-header .quick-prompts {
        display: flex !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding: 0.5rem 0 4px 0;
        min-height: 40px;
        justify-content: flex-start;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .chatbot-header .quick-prompts::-webkit-scrollbar { display: none; }
    .chat-messages { padding: 0.75rem; }
    .chat-input-container { padding: 0.5rem; }
    .voice-btn, .send-btn { width: 36px; height: 36px; }
}

@media (max-width: 480px) {
    .chatbot-header .quick-prompts {
        min-height: 44px;
        padding: 6px 0 6px 0;
    }
}
