/* AI Chatbot Styles - Beautiful Green Theme */
/* Advance Zero Waste & Infra Services Chatbot */

:root {
    --chatbot-primary: #1e5631;
    --chatbot-secondary: #2d7a4a;
    --chatbot-light: #f0f8f0;
    --chatbot-white: #ffffff;
    --chatbot-text: #333333;
    --chatbot-gray: #666666;
    --chatbot-border: #e0e0e0;
    --chatbot-shadow: rgba(30, 86, 49, 0.2);
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Toggle Button - Horizontal Layout */
.chatbot-toggle-btn {
    min-width: 140px;
    height: 56px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    border: none;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px var(--chatbot-shadow);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 20px 0 16px;
    gap: 10px;
    animation: pulse 2s infinite;
}

.chatbot-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px var(--chatbot-shadow);
}

.chatbot-toggle-btn:active {
    transform: translateY(0);
}

/* Chat Button Content Wrapper */
.chat-btn-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

/* Chat Button Text */
.chat-btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.chat-btn-label {
    font-size: 16px;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
}

.chat-btn-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Online Status Dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 8px #00ff88;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* Chat Icons */
.chat-icon,
.close-icon {
    width: 32px;
    height: 32px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-toggle-btn .close-icon {
    display: none;
}

/* Notification Badge */
.notification-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;
    border: 2px solid white;
    animation: bounce 1s infinite;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px var(--chatbot-shadow);
    }
    50% {
        box-shadow: 0 4px 30px rgba(30, 86, 49, 0.4);
    }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Chat Window */
.chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(100%) translateX(0);
    transform-origin: bottom right;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot-window.active {
    opacity: 1;
    transform: translateY(0) translateX(0);
    pointer-events: all;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: white;
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.company-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.company-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.status-online {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    margin: 4px 0 0 0;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.minimize-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.minimize-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.minimize-btn svg {
    width: 20px;
    height: 20px;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--chatbot-secondary);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--chatbot-primary);
}

/* Chat Message */
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    align-self: flex-end;
    align-items: flex-end;
}

.bot-message {
    align-self: flex-start;
    align-items: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 14px;
    word-wrap: break-word;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: white;
    color: var(--chatbot-text);
    border: 1px solid var(--chatbot-border);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message-time {
    font-size: 10px;
    color: var(--chatbot-gray);
    margin-top: 4px;
    padding: 0 4px;
}

/* Quick Actions */
.quick-actions {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-action-btn {
    padding: 8px 14px;
    background: var(--chatbot-light);
    border: 1px solid var(--chatbot-secondary);
    color: var(--chatbot-primary);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 500;
}

.quick-action-btn:hover {
    background: var(--chatbot-secondary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px var(--chatbot-shadow);
}

/* Chat Input Area */
.chat-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--chatbot-border);
    border-radius: 0 0 16px 16px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 2px solid var(--chatbot-border);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    transition: all 0.2s;
    max-height: 120px;
    overflow-y: auto;
}

.chat-input:focus {
    border-color: var(--chatbot-secondary);
    box-shadow: 0 0 0 3px rgba(45, 122, 74, 0.1);
}

.chat-input::placeholder {
    color: #999;
}

.chat-input::-webkit-scrollbar {
    width: 4px;
}

.chat-input::-webkit-scrollbar-thumb {
    background: var(--chatbot-secondary);
    border-radius: 2px;
}

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--chatbot-shadow);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* Restart Conversation Button */
.restart-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f5f5f5;
    border: 2px solid var(--chatbot-border);
    color: var(--chatbot-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
}

.restart-btn:hover {
    background: var(--chatbot-light);
    border-color: var(--chatbot-secondary);
    transform: rotate(180deg) scale(1.1);
}

.restart-btn:active {
    transform: rotate(180deg) scale(0.95);
}

.restart-btn svg {
    width: 20px;
    height: 20px;
}

/* Restart button animation on hover */
@keyframes rotate-restart {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.restart-btn:hover svg {
    animation: rotate-restart 0.6s ease-in-out;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-container {
        bottom: 10px;
        right: 10px;
    }

    .chatbot-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 80px;
        right: 10px;
    }

    .chatbot-toggle-btn {
        min-width: 120px;
        height: 50px;
        border-radius: 25px;
        padding: 0 16px 0 12px;
    }

    .chat-btn-label {
        font-size: 14px;
    }

    .chat-btn-status {
        font-size: 10px;
    }

    .chat-icon,
    .close-icon {
        width: 28px;
        height: 28px;
    }
    
    .status-dot {
        width: 7px;
        height: 7px;
    }

    .chat-messages {
        padding: 12px;
    }

    .chat-message {
        max-width: 85%;
    }

    .message-content {
        font-size: 13px;
        padding: 10px 14px;
    }

    .quick-actions {
        padding: 10px 12px;
    }

    .quick-action-btn {
        font-size: 11px;
        padding: 6px 12px;
    }

    .chat-input-container {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .chatbot-container {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-toggle-btn {
        min-width: 110px;
        height: 48px;
        border-radius: 24px;
        padding: 0 14px 0 10px;
    }

    .chat-btn-label {
        font-size: 13px;
    }

    .chat-btn-status {
        font-size: 9px;
    }

    .chat-icon,
    .close-icon {
        width: 26px;
        height: 26px;
    }

    .chatbot-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .chat-header {
        border-radius: 0;
    }

    .chat-input-container {
        border-radius: 0;
    }
}

/* Accessibility */
.chatbot-toggle-btn:focus,
.send-btn:focus,
.minimize-btn:focus,
.quick-action-btn:focus {
    outline: 3px solid var(--chatbot-secondary);
    outline-offset: 2px;
}

/* Typing Indicator (Optional) */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid var(--chatbot-border);
    border-radius: 12px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chatbot-secondary);
    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.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Print Styles */
@media print {
    .chatbot-container {
        display: none !important;
    }
}
