/* Gandhi Immigration Chatbot Styles */

#gandhi-chatbot-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2147483647;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Toggle Button */
#gandhi-chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F57D26, #d9611a);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245, 125, 38, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    margin-left: auto;
}

#gandhi-chatbot-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(245, 125, 38, 0.5);
}

#gandhi-chatbot-toggle:active {
    transform: scale(0.96);
}

/* Notification badge */
#gandhi-chatbot-toggle .gandhi-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff5252;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Chat Box */
#gandhi-chatbot-box {
    position: absolute;
    bottom: 72px;
    right: 0;
    width: 360px;
    height: 520px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: gandhi-slideUp 0.25s ease;
}

@keyframes gandhi-slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
#gandhi-chatbot-header {
    background: linear-gradient(135deg, #F57D26, #d9611a);
    padding: 16px 20px;
    color: white;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gandhi-chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

#gandhi-chatbot-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

#gandhi-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.gandhi-chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gandhi-chatbot-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}

.gandhi-chatbot-status {
    font-size: 12px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 4px;
}

.gandhi-chatbot-status::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #69f0ae;
}

/* Messages */
#gandhi-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7f8fc;
    scroll-behavior: smooth;
}

#gandhi-chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

#gandhi-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#gandhi-chatbot-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* Message Bubbles */
.gandhi-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: gandhi-fadeIn 0.2s ease;
}

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

.gandhi-message.gandhi-bot {
    align-self: flex-start;
}

.gandhi-message.gandhi-user {
    align-self: flex-end;
}

.gandhi-message-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.gandhi-bot .gandhi-message-bubble {
    background: #ffffff;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.gandhi-user .gandhi-message-bubble {
    background: linear-gradient(135deg, #F57D26, #d9611a);
    color: white;
    border-bottom-right-radius: 4px;
}

.gandhi-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 3px;
    padding: 0 4px;
}

.gandhi-bot .gandhi-message-time { align-self: flex-start; }
.gandhi-user .gandhi-message-time { align-self: flex-end; }

/* FAQ List */
.gandhi-faq-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.gandhi-faq-item {
    background: #fff;
    border: 1.5px solid #e8e8f0;
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s;
    line-height: 1.4;
}

.gandhi-faq-item:hover {
    border-color: #F57D26;
    background: #fff5f6;
    color: #F57D26;
}

/* Satisfaction Buttons */
.gandhi-satisfaction {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.gandhi-satisfaction-btn {
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid;
    transition: all 0.15s;
}

.gandhi-satisfaction-btn.yes {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.gandhi-satisfaction-btn.yes:hover {
    background: #4caf50;
    color: white;
}

.gandhi-satisfaction-btn.no {
    background: #fce4ec;
    border-color: #e91e63;
    color: #c2185b;
}

.gandhi-satisfaction-btn.no:hover {
    background: #e91e63;
    color: white;
}

/* Typing indicator */
.gandhi-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    width: fit-content;
}

.gandhi-typing span {
    width: 7px;
    height: 7px;
    background: #F57D26;
    border-radius: 50%;
    display: inline-block;
    animation: gandhi-bounce 1.2s infinite;
    opacity: 0.6;
}

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

@keyframes gandhi-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* Input Area */
#gandhi-chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #eee;
    background: white;
    flex-shrink: 0;
}

#gandhi-chatbot-input {
    flex: 1;
    border: 1.5px solid #e8e8f0;
    border-radius: 24px;
    padding: 9px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
    background: #f7f8fc;
    color: #333;
}

#gandhi-chatbot-input:focus {
    border-color: #F57D26;
    background: white;
}

#gandhi-chatbot-input::placeholder {
    color: #aaa;
}

#gandhi-chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F57D26, #d9611a);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s, opacity 0.15s;
}

#gandhi-chatbot-send:hover {
    transform: scale(1.08);
}

#gandhi-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Markdown formatting inside bot bubbles */
.gandhi-md-h3 {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 8px 0 4px;
    line-height: 1.3;
}

.gandhi-md-p {
    margin: 4px 0;
    line-height: 1.55;
}

.gandhi-md-p:first-child {
    margin-top: 0;
}

.gandhi-md-p:last-child {
    margin-bottom: 0;
}

.gandhi-md-list {
    margin: 4px 0 4px 4px;
    padding-left: 16px;
    list-style: disc;
}

.gandhi-md-list li {
    margin: 3px 0;
    line-height: 1.5;
    font-size: 13.5px;
}

/* AI Mode indicator */
.gandhi-ai-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #7b2d8b, #4a148c);
    color: white;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 6px;
    font-weight: 500;
}

/* Responsive — full-page on mobile */
@media (max-width: 768px) {
    #gandhi-chatbot-wrapper {
        bottom: 16px;
        right: 16px;
    }

    #gandhi-chatbot-box {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
        animation: none;
    }
}
