/* 
 * Anant Foundation Chatbot Styling
 * Includes mobile responsive design, bottom navigation drawer, and UI components
 */

/* Chatbot Styles */
:root {
    --chatbot-primary: #3f51b5;
    --chatbot-secondary: #303f9f;
    --chatbot-bg: #ffffff;
    --chatbot-text: #333333;
    --chatbot-light-bg: #f5f5f5;
    --chatbot-border: #e0e0e0;
    --chatbot-user-msg-bg: #e3f2fd;
    --chatbot-bot-msg-bg: #f5f5f5;
    --chatbot-button-hover: #5c6bc0;
    --chatbot-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --chatbot-border-radius: 15px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --chatbot-primary: #7986cb;
    --chatbot-secondary: #5c6bc0;
    --chatbot-bg: #303030;
    --chatbot-text: #ffffff;
    --chatbot-light-bg: #424242;
    --chatbot-border: #505050;
    --chatbot-user-msg-bg: #5c6bc0;
    --chatbot-bot-msg-bg: #424242;
    --chatbot-button-hover: #3949ab;
    --chatbot-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Colorful Theme Variables */
[data-theme="colorful"] {
    --chatbot-primary: #ff5722;
    --chatbot-secondary: #e64a19;
    --chatbot-bg: #ffffff;
    --chatbot-text: #333333;
    --chatbot-light-bg: #ffe0b2;
    --chatbot-border: #ffcc80;
    --chatbot-user-msg-bg: #ffab91;
    --chatbot-bot-msg-bg: #bbdefb;
    --chatbot-button-hover: #ff7043;
    --chatbot-shadow: 0 4px 6px rgba(255, 87, 34, 0.2);
}

/* Chatbot Container Styles */
.chatbot-widget {
    position: fixed;
    z-index: 1000;
    font-family: 'Poppins', 'Segoe UI', sans-serif;
}

/* Position Variants */
.chatbot-widget[data-position="right"] {
    bottom: 20px;
    right: 20px;
}

.chatbot-widget[data-position="left"] {
    bottom: 20px;
    left: 20px;
}

.chatbot-widget[data-position="bottom"] {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Chatbot Button */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--chatbot-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    transition: all 0.3s ease;
}

.chatbot-button:hover {
    background-color: var(--chatbot-secondary);
    transform: scale(1.05);
}

.chatbot-button i {
    color: white;
    font-size: 24px;
}

/* Chatbot Main Container */
.chatbot-container {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 350px;
    max-height: 500px;
    background-color: var(--chatbot-bg);
    border-radius: var(--chatbot-border-radius);
    box-shadow: var(--chatbot-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s ease;
}

.chatbot-container.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Position variants for the container */
.chatbot-widget[data-position="left"] .chatbot-container {
    right: auto;
    left: 0;
}

.chatbot-widget[data-position="bottom"] .chatbot-container {
    bottom: 75px;
    right: auto;
    left: 50%;
    transform: translateX(-50%) translateY(20px) scale(0.9);
}

.chatbot-widget[data-position="bottom"] .chatbot-container.active {
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Chatbot Header */
.chatbot-header {
    background-color: var(--chatbot-primary);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: var(--chatbot-border-radius);
    border-top-right-radius: var(--chatbot-border-radius);
}

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

.chatbot-close {
    cursor: pointer;
    font-size: 18px;
}

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

/* Messages Area */
.chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 350px;
    background-color: var(--chatbot-light-bg);
}

/* Message Styles */
.chat-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
    position: relative;
}

.user-message {
    background-color: var(--chatbot-user-msg-bg);
    color: var(--chatbot-text);
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.bot-message {
    background-color: var(--chatbot-bot-msg-bg);
    color: var(--chatbot-text);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

/* Quick Options */
.quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    align-self: flex-start;
}

.quick-option-btn {
    background-color: var(--chatbot-primary);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.quick-option-btn:hover {
    background-color: var(--chatbot-button-hover);
}

/* Chatbot Input Area */
.chatbot-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid var(--chatbot-border);
}

.chatbot-input input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid var(--chatbot-border);
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    background-color: var(--chatbot-light-bg);
    color: var(--chatbot-text);
}

.chatbot-input button {
    background-color: var(--chatbot-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chatbot-input button:hover {
    background-color: var(--chatbot-button-hover);
}

/* Chat Images */
.chat-image {
    align-self: flex-start;
    max-width: 80%;
    margin-top: 5px;
}

.chat-image img {
    max-width: 100%;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.chat-image img:hover {
    transform: scale(1.02);
}

/* Typing Indicator */
.typing-indicator {
    background-color: var(--chatbot-bot-msg-bg);
    padding: 10px 15px;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    align-self: flex-start;
    display: flex;
    align-items: center;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: var(--chatbot-text);
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
    opacity: 0.6;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

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

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
    margin-right: 0;
}

@keyframes typing {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0px);
    }
}

/* Voice Recording Button */
.record-button {
    background-color: var(--chatbot-primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.record-button.recording {
    background-color: #f44336;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Chatbot Tools */
.chatbot-tools {
    display: flex;
    padding: 5px 10px;
    border-top: 1px solid var(--chatbot-border);
    background-color: var(--chatbot-light-bg);
}

.tool-button {
    background: none;
    border: none;
    font-size: 14px;
    color: var(--chatbot-primary);
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 15px;
    transition: background-color 0.2s ease;
}

.tool-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Settings Panel */
.chatbot-settings {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--chatbot-bg);
    z-index: 10;
    padding: 15px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.chatbot-settings.active {
    opacity: 1;
    visibility: visible;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.settings-header h3 {
    margin: 0;
    color: var(--chatbot-primary);
}

.settings-close {
    cursor: pointer;
    font-size: 18px;
    color: var(--chatbot-text);
}

.settings-option {
    margin-bottom: 15px;
}

.settings-option label {
    display: block;
    margin-bottom: 5px;
    color: var(--chatbot-text);
    font-weight: 500;
}

.settings-option select,
.settings-option input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--chatbot-border);
    border-radius: 5px;
    background-color: var(--chatbot-light-bg);
    color: var(--chatbot-text);
}

.settings-save {
    background-color: var(--chatbot-primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    margin-top: auto;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.settings-save:hover {
    background-color: var(--chatbot-button-hover);
}

/* Language Selector */
.language-selector {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.language-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--chatbot-border);
    border-radius: 5px;
    background-color: var(--chatbot-light-bg);
    color: var(--chatbot-text);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.language-btn.active {
    background-color: var(--chatbot-primary);
    color: white;
    border-color: var(--chatbot-primary);
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .bottom-nav-drawer {
        display: block;
    }
    
    .chatbot-container {
        bottom: 70px;
        right: 50%;
        transform: translateX(50%) translateY(20px) scale(0.9);
        width: 90%;
        max-width: 350px;
        height: 60vh;
        max-height: 500px;
    }
    
    .chatbot-container.active {
        transform: translateX(50%) translateY(0) scale(1);
    }
    
    .chatbot-button {
        bottom: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-button {
        bottom: 80px;
        left: 20px;
        width: 50px;
        height: 50px;
    }
    
    body {
        padding-bottom: 60px; /* Space for the drawer */
    }
}

/* Small screens */
@media screen and (max-width: 480px) {
    .bottom-nav-drawer .drawer-tab {
        font-size: 10px;
    }
    
    .bottom-nav-drawer .drawer-tab i {
        font-size: 18px;
    }
    
    .chatbot-container {
        width: 300px;
        bottom: 70px;
    }

    .chatbot-widget[data-position="bottom"] .chatbot-container {
        width: 90vw;
        max-width: 350px;
    }
    
    .chatbot-header h3 {
        font-size: 16px;
    }
    
    .chat-message {
        max-width: 85%;
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .quick-option-btn {
        padding: 5px 10px;
        font-size: 13px;
    }
} 