/* Mega FAQ Chatbot Styles */

/* Chatbot Container */
.mega-faq-chatbot {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 13px;
    line-height: 1.4;
}

/* Position variants - simple and consistent positioning */
.mega-faq-chatbot.bottom-right {
    bottom: 5rem;
    right: 5rem;
}

.mega-faq-chatbot.bottom-left {
    bottom: 2rem;
    left: 2rem;
}

.mega-faq-chatbot.top-right {
    top: 2rem;
    right: 2rem;
}

.mega-faq-chatbot.top-left {
    top: 2rem;
    left: 2rem;
}

/* Floating Help Message */
.chatbot-help-message {
    position: fixed;
    background: #F9CA00;
    color: white;
    padding: 15px 20px;
    border-radius: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    font-weight: 500;
    z-index: 9998;
    max-width: 280px;
    line-height: 1.4;
    animation: helpMessageSlideIn 0.5s ease;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatbot-help-message:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    background: #000;
    color: #F9CA00;
}

.chatbot-help-message::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #F9CA00;
    bottom: -8px;
    right: 20px;
    transition: border-top-color 0.3s ease;
}

.chatbot-help-message:hover::after {
    border-top-color: #000;
}

.chatbot-help-message.hide {
    animation: helpMessageSlideOut 0.5s ease forwards;
}

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

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

/* Position variants for help message - simple and consistent */
.chatbot-help-message.bottom-right {
    bottom: 5rem;
    right: 2rem;
}

.chatbot-help-message.bottom-left {
    bottom: 5rem;
    left: 2rem;
}

.chatbot-help-message.top-right {
    top: 5rem;
    right: 2rem;
}

.chatbot-help-message.top-left {
    top: 5rem;
    left: 2rem;
}

/* Chatbot Button */
.chatbot-button {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #F9CA00;
    border: 0;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 24px;
    z-index: 10001;
    /* Ensure button is always visible */
    visibility: visible !important;
    opacity: 1 !important;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    background: #000;
    color: #F9CA00;
}

.chatbot-button:hover img {
    filter: brightness(0) invert(1);
}

.chatbot-button img {
    width: 35px;
    height: 35px;
    filter: brightness(0); /* Make icon black by default */
    transition: filter 0.3s ease;
}

.chatbot-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 202, 0, 0.3);
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 1rem;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease;
    z-index: 10001;
}

.chatbot-window.active {
    display: flex;
}

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

/* Chatbot Header */
.chatbot-header {
    background: #000;
    color: #F9CA00;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header h3 {
    color: white;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Chatbot Body */
.chatbot-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    min-height: 0; /* Important for flexbox */
    position: relative;
}

/* Top scroll indicator */
.chatbot-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0.9), transparent);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chatbot-body.scrollable-top::before {
    opacity: 1;
}

/* Bottom scroll indicator */
.chatbot-body::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(248, 249, 250, 0.9), transparent);
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chatbot-body.scrollable-bottom::after {
    opacity: 1;
}

/* Scroll hint text */
.chatbot-scroll-hint {
    text-align: center;
    color: #6c757d;
    font-size: 11px;
    padding: 8px;
    background: rgba(249, 202, 0, 0.1);
    border-radius: 6px;
    margin: 10px 0;
    border: 1px dashed rgba(249, 202, 0, 0.3);
    animation: scrollHintPulse 2s ease-in-out infinite;
}

@keyframes scrollHintPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Enhanced scrollbar for body container */
.chatbot-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(249, 202, 0, 0.6) transparent;
}

.chatbot-body::-webkit-scrollbar {
    width: 8px;
}

.chatbot-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.chatbot-body::-webkit-scrollbar-thumb {
    background-color: rgba(249, 202, 0, 0.6);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.chatbot-body::-webkit-scrollbar-thumb:hover {
    background-color: rgba(249, 202, 0, 0.8);
}

.chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 100%;
    flex: 1;
}

/* Message Styles */
.chatbot-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    animation: messageSlide 0.3s ease;
}

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

.chatbot-message.bot {
    background: white;
    color: #333;
    border: 1px solid #e9ecef;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chatbot-message.user {
    background: #0000000d;
    color: black;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Button Styles */
.chatbot-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.chatbot-option {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    display: block;
}

.chatbot-option:hover {
    background: white;
    border-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #000;
}

.chatbot-option:focus {
    outline: none;
    border-color: #F9CA00;
    box-shadow: 0 0 0 3px rgba(249, 202, 0, 0.1);
}

/* Navigation Buttons */
.chatbot-nav {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.chatbot-nav-btn {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.chatbot-nav-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.chatbot-nav-btn.primary {
    background: #F9CA00;
    color: #000;
}

.chatbot-nav-btn.primary:hover {
    background: #000;
    color: #F9CA00;
}

.chatbot-nav-btn.whatsapp {
    background: #25d366;
}

.chatbot-nav-btn.whatsapp:hover {
    background: #20ba5a;
}

/* Answer Display */
.chatbot-answer {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-top: 10px;
    line-height: 1.6;
    color: #333;
}

/* Loading Animation */
.chatbot-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-style: italic;
}

.chatbot-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #F9CA00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design - only for window size, not positioning */
@media (max-width: 480px) {
    .chatbot-window {
        right: -3.5rem;
    }
    
    .chatbot-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .chatbot-button img {
        width: 28px;
        height: 28px;
    }
    
    .chatbot-body {
        padding: 15px;
    }
    
    .chatbot-option {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .chatbot-input-container {
        padding: 10px 15px;
    }
    
    .chatbot-input {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .chatbot-send-btn {
        width: 35px;
        height: 35px;
        font-size: 13px;
    }

    .chatbot-help-message {
        max-width: calc(100vw - 1rem);
        font-size: 12px;
        padding: 12px 16px;
    }
    
    .chatbot-suggestion-btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .chatbot-scroll-hint {
        font-size: 10px;
        padding: 6px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .chatbot-window {
        width: calc(100vw - 0.5rem);
        right: 0.25rem;
        left: 0.25rem;
        max-width: calc(100vw - 0.5rem);
    }
    
    .chatbot-body {
        padding: 10px;
    }
    
    .chatbot-input-container {
        padding: 8px 10px;
    }
    
    .chatbot-option {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .chatbot-help-message {
        max-width: calc(100vw - 0.5rem);
        padding: 10px 12px;
        font-size: 11px;
    }
}

/* Ensure chatbot button is always visible */
.chatbot-button {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10001 !important;
    position: fixed !important;
}

.mega-faq-chatbot {
    z-index: 10001 !important;
}

/* Override any potential hiding from other CSS */
.chatbot-button[style*="display: none"],
.chatbot-button[style*="visibility: hidden"],
.chatbot-button[style*="opacity: 0"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Accessibility */
.chatbot-button:focus,
.chatbot-option:focus,
.chatbot-nav-btn:focus {
    outline: 2px solid #F9CA00;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .chatbot-button {
        border: 2px solid #000;
    }
    
    .chatbot-option {
        border: 2px solid #000;
    }
    
    .chatbot-message.bot {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .chatbot-button,
    .chatbot-option,
    .chatbot-nav-btn {
        transition: none;
    }
    
    .chatbot-window {
        animation: none;
    }
    
    .chatbot-message {
        animation: none;
    }
    
    .chatbot-loading::after {
        animation: none;
    }
}

/* Custom scrollbar for chatbot messages */
.chatbot-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(249, 202, 0, 0.6) transparent;
    scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background-color: rgba(249, 202, 0, 0.6);
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background-color: rgba(249, 202, 0, 0.8);
}

/* Input Container */
.chatbot-input-container {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
    background: #f8f9fa;
}

.chatbot-input:focus {
    border-color: #F9CA00;
    background: white;
    box-shadow: 0 0 0 3px rgba(249, 202, 0, 0.1);
}

.chatbot-input::placeholder {
    color: #6c757d;
}

.chatbot-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #F9CA00;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chatbot-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    background: #000;
    color: #F9CA00;
}

.chatbot-send-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(249, 202, 0, 0.3);
}

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

/* Suggestions styling */
.chatbot-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.chatbot-suggestion-btn {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    display: block;
}

.chatbot-suggestion-btn:hover {
    background: white;
    border-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #000;
}

.chatbot-suggestion-btn:focus {
    outline: none;
    border-color: #F9CA00;
    box-shadow: 0 0 0 3px rgba(249, 202, 0, 0.1);
}

/* Responsive suggestions */
@media (max-width: 480px) {
    .chatbot-suggestion-btn {
        font-size: 13px;
        padding: 8px 12px;
    }
} 