/**
 * Tron7 Assistant - Chatbot Widget Styles
 * Floating chat widget with premium design
 */

/* Widget Container */
.tron7-chatbot {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9998;
    font-family: 'DM Sans', sans-serif;
}

/* Hide chatbot when mobile nav is open */
body.nav-open .tron7-chatbot {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Toggle Button */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5EC3CA 0%, #273171 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(39, 49, 113, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(39, 49, 113, 0.5);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
    transition: all 0.3s ease;
}

.chatbot-toggle .chat-icon {
    opacity: 1;
    transform: scale(1);
}

.chatbot-toggle .close-icon {
    position: absolute;
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

.tron7-chatbot.open .chatbot-toggle .chat-icon {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

.tron7-chatbot.open .chatbot-toggle .close-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* Badge */
.chatbot-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: #dc3545;
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 550px;
    max-height: calc(100vh - 150px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tron7-chatbot.open .chatbot-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.chatbot-header {
    position: relative;
    background: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #5EC3CA 0%, #273171 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbot-avatar svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
}

.chatbot-header-text h4 {
    color: #1f2937;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 2px 0;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-close {
    width: 36px;
    height: 36px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbot-close:hover {
    background: #e5e7eb;
}

.chatbot-close svg {
    width: 18px;
    height: 18px;
    color: #374151;
}

/* Messages Container */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #ffffff;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* Message Styles */
.chatbot-message {
    display: flex;
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

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

.chatbot-message.user {
    margin-left: auto;
}

.chatbot-message.bot {
    margin-right: auto;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.chatbot-message.user .message-content {
    background: linear-gradient(135deg, #5EC3CA 0%, #4ba8ae 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chatbot-message.bot .message-content {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.message-content a {
    color: inherit;
    text-decoration: underline;
}

.chatbot-message.user .message-content a {
    color: white;
}

.chatbot-message.bot .message-content a {
    color: #0891b2;
}

.message-time {
    display: block;
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #5EC3CA;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Quick Actions */
.chatbot-quick-actions {
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: white;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.quick-action-btn {
    padding: 8px 16px;
    background: #f0f7f7;
    border: 1px solid #5EC3CA;
    border-radius: 20px;
    font-size: 13px;
    color: #273171;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: #5EC3CA;
    color: white;
}

/* Input Area */
.chatbot-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.chatbot-input-area form {
    display: flex;
    gap: 12px;
    align-items: center;
}

#chatbotInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

#chatbotInput:focus {
    border-color: #5EC3CA;
}

#chatbotInput::placeholder {
    color: #9ca3af;
}

#chatbotSend {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #5EC3CA 0%, #273171 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#chatbotSend:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(94, 195, 202, 0.4);
}

#chatbotSend svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Tablet Responsive */
@media (max-width: 768px) {
    .chatbot-window {
        width: 340px;
        height: 500px;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .tron7-chatbot {
        bottom: 16px;
        right: 16px;
        z-index: 9998;
    }

    .chatbot-toggle {
        width: 52px;
        height: 52px;
    }

    .chatbot-window {
        width: calc(100vw - 32px);
        max-width: 340px;
        height: 420px;
        max-height: calc(100vh - 100px);
        bottom: 70px;
        right: 0;
        border-radius: 16px;
    }

    .chatbot-header {
        padding: 12px 14px;
    }

    .chatbot-avatar {
        width: 36px;
        height: 36px;
    }

    .chatbot-avatar svg {
        width: 18px;
        height: 18px;
    }

    .chatbot-header-text h4 {
        font-size: 14px;
    }

    .chatbot-close {
        width: 32px;
        height: 32px;
    }

    .chatbot-close svg {
        width: 16px;
        height: 16px;
    }

    .chatbot-messages {
        padding: 12px;
        padding-bottom: 8px;
    }

    .chatbot-message {
        max-width: 90%;
    }

    .message-content {
        padding: 10px 14px;
    }

    .message-content p {
        font-size: 14px;
    }

    .chatbot-quick-actions {
        padding: 8px 12px;
        gap: 6px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .quick-action-btn {
        padding: 5px 10px;
        font-size: 11px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .chatbot-input-area {
        padding: 10px 12px;
    }

    .chatbot-input-area form {
        gap: 8px;
    }

    #chatbotInput {
        padding: 8px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-width: 0;
    }

    #chatbotSend {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    #chatbotSend svg {
        width: 16px;
        height: 16px;
    }

    .chatbot-powered-by {
        padding: 6px 12px;
        font-size: 9px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .tron7-chatbot {
        bottom: 12px;
        right: 12px;
    }

    .chatbot-toggle {
        width: 48px;
        height: 48px;
    }

    .chatbot-window {
        width: calc(100vw - 24px);
        height: 380px;
        max-height: calc(100vh - 90px);
        bottom: 65px;
    }

    .chatbot-header {
        padding: 10px;
    }

    .chatbot-header-info {
        gap: 8px;
    }

    .chatbot-avatar {
        width: 32px;
        height: 32px;
    }

    .chatbot-header-text h4 {
        font-size: 13px;
    }

    .chatbot-status {
        font-size: 10px;
    }

    .chatbot-close {
        width: 28px;
        height: 28px;
    }

    .chatbot-messages {
        padding: 10px;
        gap: 10px;
    }

    .chatbot-quick-actions {
        padding: 6px 10px;
    }

    .quick-action-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .chatbot-input-area {
        padding: 10px 12px;
    }

    #chatbotInput {
        padding: 8px 12px;
    }

    #chatbotSend {
        width: 36px;
        height: 36px;
    }
}

/* Powered By */
.chatbot-powered-by {
    padding: 8px 20px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.chatbot-powered-by a {
    color: #5EC3CA;
    text-decoration: none;
    font-weight: 500;
}

.chatbot-powered-by a:hover {
    text-decoration: underline;
}

/* Dark mode disabled - using light theme only */

