/* Chatbot Widget Styles */

:root {
    --chatbot-primary: #1a7f5f;
    --chatbot-secondary: #f0f0f0;
    --chatbot-text: #333;
    --chatbot-border: #ddd;
}

#chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    z-index: 9999;
}

/* Mobile Widget */
@media (max-width: 480px) {
    #chatbot-widget {
        bottom: 15px;
        right: 15px;
    }
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chatbot-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
}

/* Mobile Toggle Button */
@media (max-width: 480px) {
    .chatbot-toggle {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }
}

/* Tablet Toggle Button */
@media (max-width: 768px) {
    .chatbot-toggle {
        width: 58px;
        height: 58px;
    }
}

.chatbot-toggle:hover {
    background: #155a47;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chatbot-toggle:active {
    transform: scale(0.95);
}

.chatbot-icon {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

/* Mobile Responsive - Small phones (320px - 480px) */
@media (max-width: 480px) {
    .chatbot-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        z-index: 10000;
    }
}

/* Tablet (481px - 768px) */
@media (max-width: 768px) {
    .chatbot-window {
        width: 90vw;
        height: 80vh;
        max-height: 600px;
        bottom: 70px;
        right: 10px;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chatbot-header {
    background: var(--chatbot-primary);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

/* Mobile Header */
@media (max-width: 480px) {
    .chatbot-header {
        padding: 14px 12px;
    }
    
    .chatbot-header h3 {
        font-size: 15px;
    }
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.2s;
}

.chatbot-close:hover {
    transform: rotate(90deg);
}

.chatbot-close svg {
    width: 20px;
    height: 20px;
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #1a1a1a;
    justify-content: flex-start;
}

/* Empty State - Centered Text */
.chatbot-empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    height: 100%;
    flex: 1;
}

.chatbot-empty-state p {
    font-size: 16px;
    color: #666;
    font-weight: 400;
    line-height: 1.5;
    max-width: 80%;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Messages */
.chatbot-message {
    display: flex;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbot-message p {
    margin: 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    max-width: 85%;
    word-wrap: break-word;
}

/* Mobile Messages */
@media (max-width: 480px) {
    .chatbot-message p {
        font-size: 13px;
        padding: 8px 12px;
        max-width: 90%;
    }
}

/* User Message - RIGHT SIDE */
.user-message {
    justify-content: flex-end;
}

.user-message p {
    background: var(--chatbot-primary);
    color: white;
    border-bottom-right-radius: 2px;
}

/* Bot Message - LEFT SIDE */
.bot-message {
    justify-content: flex-start;
}

.bot-message p {
    background: #333;
    color: #ccc;
    border: 1px solid #444;
    border-bottom-left-radius: 2px;
}

/* Typing Indicator */
.typing p {
    padding: 10px 14px;
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.5;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}

/* Input Area */
.chatbot-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--chatbot-border);
    background: white;
}

.chatbot-input {
    flex: 1;
    border: 1px solid var(--chatbot-border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: var(--chatbot-primary);
}

.chatbot-input::placeholder {
    color: #999;
}

.chatbot-send {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    background: var(--chatbot-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

/* Mobile Input Area */
@media (max-width: 480px) {
    .chatbot-input-area {
        padding: 10px;
        gap: 6px;
    }
    
    .chatbot-input {
        padding: 10px 10px;
        font-size: 16px;
    }
    
    .chatbot-send {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .chatbot-send svg {
        width: 20px;
        height: 20px;
    }
}

.chatbot-send:hover {
    background: #155a47;
    transform: scale(1.05);
}

.chatbot-send:active {
    transform: scale(0.95);
}

.chatbot-send svg {
    width: 18px;
    height: 18px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #chatbot-widget {
        bottom: 10px;
        right: 10px;
    }
    
    .chatbot-toggle {
        width: 50px;
        height: 50px;
    }
    
    .chatbot-icon {
        width: 24px;
        height: 24px;
    }
    
    .chatbot-window {
        width: calc(100vw - 20px);
        height: 60vh;
        max-height: 500px;
        bottom: 70px;
        right: 10px;
        left: 10px;
    }
    
    .chatbot-message p {
        max-width: 90%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .chatbot-window {
        background: #2a2a2a;
    }
    
    .chatbot-messages {
        background: #1a1a1a;
    }
    
    .bot-message p {
        background: #333;
        color: #e0e0e0;
        border-color: #444;
    }
    
    .chatbot-input {
        background: #333;
        color: #e0e0e0;
        border-color: #444;
    }
    
    .chatbot-input::placeholder {
        color: #666;
    }
}
