/* Chatbot Modal Styles */
.chatbot-modal {
    position: fixed;
    bottom: 90px;
    right: 30px;
    width: 420px;
    height: 600px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

.chatbot-modal.show {
    display: flex;
}

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

.chatbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #DEE2E6;
    background: #0066FF;
    color: #FFFFFF;
    border-radius: 16px 16px 0 0;
}

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

.chatbot-logo {
    height: 24px;
    width: auto;
    filter: brightness(0) invert(1);
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.chatbot-close:hover {
    opacity: 0.8;
}

.chatbot-close svg {
    width: 20px;
    height: 20px;
}

.chatbot-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #CED4DA;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #ADB5BD;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
}

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

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.bot-message .message-bubble {
    background: #F8F9FA;
    color: #343A40;
    border-bottom-left-radius: 4px;
}

.user-message .message-bubble {
    background: #0066FF;
    color: #FFFFFF;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    padding: 15px;
    border-top: 1px solid #DEE2E6;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #CED4DA;
    border-radius: 24px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.chat-input:focus {
    border-color: #0066FF;
}

.chat-input::placeholder {
    color: #ADB5BD;
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0066FF;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-send-btn:hover {
    background: #4DA6FF;
    transform: scale(1.05);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn svg {
    width: 18px;
    height: 18px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #F8F9FA;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ADB5BD;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Chat Menu Styles */
.chat-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.menu-section {
    background: #F8F9FA;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #E9ECEF;
}

.menu-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: #FFFFFF;
    border: 1px solid #DEE2E6;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-align: center;
    min-height: 48px;
    white-space: nowrap;
}

.menu-item:hover {
    background: #0066FF;
    color: #FFFFFF;
    border-color: #0066FF;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.2);
}

.menu-item:active {
    transform: translateY(0);
}

/* Single column for certain menus */
.menu-single {
    grid-template-columns: 1fr;
}

/* Small menu item variant */
.menu-item.small {
    padding: 8px 12px;
    font-size: 0.813rem;
    min-height: 36px;
}

/* Primary action button */
.menu-item.primary {
    background: #0066FF;
    color: #FFFFFF;
    border-color: #0066FF;
    font-weight: 500;
}

.menu-item.primary:hover {
    background: #0052CC;
    border-color: #0052CC;
}

/* Status indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #E7F5FF;
    border: 1px solid #74C0FC;
    border-radius: 20px;
    font-size: 0.813rem;
    color: #1971C2;
    margin-bottom: 12px;
}

.status-indicator.offline {
    background: #FFF5F5;
    border-color: #FFA8A8;
    color: #C92A2A;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #40C057;
    animation: pulse 2s infinite;
}

.status-indicator.offline .status-dot {
    background: #F03E3E;
    animation: none;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(64, 192, 87, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(64, 192, 87, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(64, 192, 87, 0);
    }
}

/* Message bubble link styles */
.message-bubble a {
    color: #0066FF;
    text-decoration: none;
    font-weight: 500;
}

.message-bubble a:hover {
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .chatbot-modal {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        border-radius: 0;
        animation: slideUpMobile 0.3s ease-out;
    }
    
    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
    
    .chatbot-header {
        border-radius: 0;
        padding: 16px 20px;
    }
    
    .chat-messages {
        padding: 16px;
    }
    
    .chat-input-area {
        padding: 12px 16px;
        padding-bottom: env(safe-area-inset-bottom, 12px);
    }
}

/* Desktop hover effects */
@media (min-width: 769px) {
    .chatbot-modal {
        transition: box-shadow 0.3s ease;
    }
    
    .chatbot-modal:hover {
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    }
}
