/* ===================================
   Boketto Solutions - Chatbot Styles
   =================================== */

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

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

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

.chatbot-toggle i {
    font-size: 1.5rem;
    color: white;
}

.chatbot-notification {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    border-radius: 50%;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: pulse-notification 2s ease-in-out infinite;
}

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

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: #0f172a;
    border-radius: 20px;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

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

.chatbot-container.open .chatbot-toggle {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* Chat Header */
.chatbot-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

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

.chatbot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.chatbot-header-text h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: white;
}

.chatbot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

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

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

/* Chat Messages */
.chat-message {
    display: flex;
    gap: 10px;
    max-width: 85%;
    animation: messageIn 0.3s ease;
}

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

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bot-message {
    align-self: flex-start;
}

.bot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 6px;
}

.bot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-line;
}

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

.bot-message .message-content {
    background: #1e293b;
    color: rgba(255, 255, 255, 0.9);
    border-bottom-left-radius: 4px;
}

.bot-message .message-content a {
    color: #22d3ee;
    text-decoration: none;
    font-weight: 500;
}

.bot-message .message-content a:hover {
    text-decoration: underline;
}

.bot-message .message-content strong {
    color: #fff;
}

.message-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
    padding: 0 4px;
}

.user-message .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator .typing-dots {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #1e293b;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
}

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

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Quick Actions */
.chatbot-quick-actions {
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    background: #0f172a;
}

.quick-action-btn {
    padding: 8px 14px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    color: #a5b4fc;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: white;
}

/* Input Form */
.chatbot-form {
    padding: 16px 20px;
    background: #1e293b;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.chatbot-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #0f172a;
    border-radius: 12px;
    padding: 4px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: border-color 0.2s ease;
}

.chatbot-input-container:focus-within {
    border-color: rgba(99, 102, 241, 0.5);
}

.chatbot-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px;
    color: white;
    font-size: 0.9rem;
    outline: none;
}

.chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chatbot-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.chatbot-send i {
    font-size: 1rem;
}

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

    .chatbot-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 140px);
        max-height: 550px;
        bottom: 70px;
        right: -8px;
    }

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

    .chatbot-toggle i {
        font-size: 1.3rem;
    }

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

/* Animation for opening */
.chatbot-container.open .chatbot-toggle i::before {
    content: "\F62A"; /* bi-x-lg */
}

/* Pulse animation for toggle */
.chatbot-toggle::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
    animation: pulse-ring 2s ease-out infinite;
    z-index: -1;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}
