/* ============================================
   MODERN CHATBOT WIDGET STYLES - Question Based
   ============================================ */

* {
    box-sizing: border-box;
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 420px;
    max-height: 700px;
    display: none;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    box-shadow: 0 5px 40px rgba(45, 139, 111, 0.16);
    z-index: 9999;
    font-family: 'Montserrat', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-container.open {
    display: flex;
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #2D8B6F 0%, #3EB489 100%);
    color: white;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.chatbot-header-content {
    flex: 1;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.chatbot-header p {
    margin: 6px 0 0 0;
    font-size: 12px;
    opacity: 0.95;
    font-weight: 500;
}

.chatbot-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    padding: 4px 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 6px;
    flex-shrink: 0;
}

.chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chatbot Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px;
    background: linear-gradient(135deg, #f8fafb 0%, #f0f3f6 100%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 150px;
}

/* Message Styles */
.chatbot-message {
    display: flex;
    margin-bottom: 8px;
    animation: fadeInUp 0.3s ease-out;
}

.chatbot-message.user {
    justify-content: flex-end;
}

.chatbot-message.bot {
    justify-content: flex-start;
}

.message-content {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 14px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 13px;
    font-weight: 500;
}

.message-content.user-message {
    background: linear-gradient(135deg, #2D8B6F 0%, #3EB489 100%);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(45, 139, 111, 0.2);
}

.message-content.bot-message {
    background-color: white;
    color: #2c3e50;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8eef5;
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Questions/Buttons Area */
.chatbot-questions-area {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px 12px;
    background: white;
    border-top: 1px solid #e8eef5;
    flex-shrink: 0;
    max-height: 300px;
    overflow-y: auto;
}

.chatbot-questions-area.single-column {
    grid-template-columns: 1fr;
    gap: 10px;
}

.chatbot-questions-area::-webkit-scrollbar {
    width: 5px;
}

.chatbot-questions-area::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.chatbot-questions-area::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Question Buttons - Category Cards */
.chatbot-question-btn {
    background: linear-gradient(135deg, #f8fafb 0%, #f0f3f6 100%);
    border: 2px solid #e8eef5;
    color: #2c3e50;
    padding: 14px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 90px;
    position: relative;
    overflow: hidden;
}

.chatbot-question-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.chatbot-question-btn:hover::before {
    left: 100%;
}

.chatbot-question-btn .question-icon {
    font-size: 28px;
    line-height: 1;
    display: block;
}

.chatbot-question-btn .question-text {
    flex: 1;
    display: block;
    word-break: break-word;
    line-height: 1.3;
    font-size: 12px;
}

.chatbot-question-btn:hover {
    background: linear-gradient(135deg, #2D8B6F 0%, #3EB489 100%);
    color: white;
    border-color: #2D8B6F;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(45, 139, 111, 0.3);
}

.chatbot-question-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(45, 139, 111, 0.2);
}

/* Single Column Questions (for sub-categories) */
.chatbot-question-btn.single-question {
    grid-column: span 1;
    flex-direction: row;
    min-height: 50px;
    text-align: left;
    padding: 12px 14px;
    justify-content: flex-start;
}

.chatbot-question-btn.single-question .question-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.chatbot-question-btn.single-question .question-text {
    font-size: 13px;
}

.chatbot-question-btn.back-btn {
    background: linear-gradient(135deg, #f5f7fa 0%, #eff2f7 100%);
    border-color: #cbd5e0;
    color: #64748b;
    grid-column: 1 / -1;
    min-height: 50px;
    flex-direction: row;
    text-align: left;
    padding: 12px 14px;
    justify-content: flex-start;
}

.chatbot-question-btn.back-btn .question-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.chatbot-question-btn.back-btn .question-text {
    font-size: 13px;
}

.chatbot-question-btn.back-btn:hover {
    background: linear-gradient(135deg, #475569 0%, #64748b 100%);
    color: white;
    border-color: #475569;
    box-shadow: 0 4px 12px rgba(45, 139, 111, 0.2);
}

/* Footer with Contact Button */
.chatbot-footer {
    padding: 14px 12px;
    background: linear-gradient(135deg, #f8fafb 0%, #f0f3f6 100%);
    border-top: 1px solid #e8eef5;
}

.chatbot-contact-btn {
    width: 100%;
    background: linear-gradient(135deg, #2D8B6F 0%, #3EB489 100%);
    color: white;
    border: none;
    padding: 13px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 3px 10px rgba(45, 139, 111, 0.25);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.chatbot-contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(45, 139, 111, 0.35);
}

.chatbot-contact-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(45, 139, 111, 0.2);
}

/* Chatbot Toggle Button */
.chatbot-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #2D8B6F 0%, #3EB489 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 28px;
    box-shadow: 0 4px 20px rgba(45, 139, 111, 0.35);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: floatingPulse 3s ease-in-out infinite;
}

.chat-icon {
    font-size: 32px;
    line-height: 1;
}

.chat-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.95;
}

.chatbot-toggle-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 8px 30px rgba(45, 139, 111, 0.45);
}

.chatbot-toggle-btn:active {
    transform: scale(0.95);
}

.chatbot-toggle-btn.active {
    display: none;
}

@keyframes floatingPulse {
    0%, 100% {
        transform: translateY(0px);
        box-shadow: 0 4px 20px rgba(45, 139, 111, 0.35);
    }
    50% {
        transform: translateY(-8px);
        box-shadow: 0 8px 30px rgba(45, 139, 111, 0.5);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    70% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
}

/* Floating Tooltip Banner Styles */
.chatbot-banner {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: linear-gradient(135deg, #2D8B6F 0%, #3EB489 100%);
    color: white;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 6px 25px rgba(45, 139, 111, 0.35);
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: 'Montserrat', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 280px;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-banner.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    animation: slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-banner.hidden {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    pointer-events: none;
    animation: slideOutDown 0.5s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.banner-content {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

.banner-text {
    display: block;
}

.banner-close-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-weight: 700;
}

.banner-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

.banner-close-btn:active {
    transform: rotate(90deg) scale(0.9);
    background: rgba(255, 255, 255, 0.25);
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .chatbot-container {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        z-index: 10000;
    }

    .chatbot-header {
        padding: 20px;
    }

    .chatbot-toggle-btn {
        width: 60px;
        height: 60px;
        bottom: 15px;
        right: 15px;
    }

    .chat-icon {
        font-size: 28px;
    }

    .chatbot-message {
        margin-bottom: 6px;
    }

    .message-content {
        max-width: 90%;
        font-size: 13px;
        padding: 10px 14px;
    }

    .chatbot-questions-area {
        padding: 12px;
        gap: 8px;
    }

    .chatbot-question-btn {
        padding: 10px 14px;
        font-size: 12px;
        min-height: 40px;
    }

    .chatbot-banner {
        bottom: 80px;
        right: 15px;
        max-width: 260px;
        padding: 12px 14px;
        font-size: 13px;
    }

    .banner-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        width: 100%;
    }

    .chatbot-header h3 {
        font-size: 18px;
    }

    .chatbot-question-btn {
        padding: 9px 12px;
        font-size: 12px;
    }
}

/* Accessibility */
.chatbot-question-btn:focus,
.chatbot-contact-btn:focus,
.chatbot-toggle-btn:focus {
    outline: 2px solid #2D8B6F;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .chatbot-container {
        background: #1a202c;
    }

    .chatbot-header {
        background: linear-gradient(135deg, #1f3a34 0%, #2d5a4f 100%);
    }

    .chatbot-messages {
        background: linear-gradient(135deg, #0f1419 0%, #1a202c 100%);
    }

    .message-content.bot-message {
        background-color: #2d3748;
        color: #e2e8f0;
        border-color: #4a5568;
    }

    .chatbot-questions-area {
        background: #1a202c;
        border-top-color: #4a5568;
    }

    .chatbot-question-btn {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .chatbot-question-btn:hover {
        background: linear-gradient(135deg, #2D8B6F 0%, #3EB489 100%);
    }

    .chatbot-question-btn.back-btn {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
        color: #cbd5e0;
    }

    .chatbot-footer {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
        border-top-color: #4a5568;
    }
}
