/**
 * AI-Powered Customer Support Chatbot Styles
 * Digital Teknoloji - WhatsApp Destek Widget
 */

/* Chatbot Button - Fixed Bottom Right */
#ai-chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Open Sans', sans-serif;
}

.ai-chatbot-button {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    color: #ffffff;
    position: relative;
}

.ai-chatbot-button:hover {
    background: #20BA5A;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.5);
    transform: scale(1.05);
}

.ai-chatbot-button.active {
    background: #128C7E;
}

.ai-chatbot-button svg {
    width: 28px;
    height: 28px;
    margin-bottom: 2px;
}

.ai-chatbot-button span {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    margin-top: 2px;
}

/* Chatbot Window */
.ai-chatbot-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    z-index: 10000;
    overflow: hidden;
}

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

/* Chatbot Header */
.ai-chatbot-header {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

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

.ai-chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.ai-chatbot-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.ai-chatbot-header-info p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.2;
}

.ai-chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
}

.ai-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Messages Area */
.ai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: messageSlideIn 0.3s ease;
}

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

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

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

.message-content {
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.5;
    width: fit-content;
    max-width: 100%;
}

.bot-message .message-content {
    background: #ffffff;
    border-bottom-left-radius: 4px;
}

.user-message .message-content {
    background: #DCF8C6;
    border-bottom-right-radius: 4px;
}

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

.message-content p + p {
    margin-top: 8px;
}

.message-content strong {
    color: #0c243d;
    font-weight: 600;
}

/* Typing Indicator */
.typing {
    opacity: 0.7;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Message Actions */
.message-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: flex-start;
}

.message-actions.feedback-actions {
    margin-top: 8px;
    opacity: 0.95;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
}

.whatsapp-btn {
    background: #25D366;
    color: #ffffff;
}

.whatsapp-btn:hover {
    background: #20BA5A;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.link-btn {
    background: #919303;
    color: #ffffff;
}

.link-btn:hover {
    background: #919303;
    color: #ffffff;
    transform: translateY(-1px);
}

.phone-btn {
    background: #0c243d;
    color: #ffffff;
}

.phone-btn:hover {
    background: #1a3a5a;
    transform: translateY(-1px);
}

/* Input Area */
.ai-chatbot-input-area {
    padding: 15px;
    background: #ffffff;
    border-top: 1px solid #e1e1e1;
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

#ai-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e1e1e1;
    border-radius: 24px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    outline: none;
    transition: all 0.2s;
}

#ai-chatbot-input:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1);
}

.ai-chatbot-send {
    width: 44px;
    height: 44px;
    background: #25D366;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-chatbot-send:hover {
    background: #20BA5A;
    transform: scale(1.1);
}

.ai-chatbot-send:active {
    transform: scale(0.95);
}

.ai-chatbot-send svg {
    width: 20px;
    height: 20px;
}

/* Scrollbar Styling */
.ai-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

.ai-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Responsive */
@media (max-width: 768px) {
    #ai-chatbot-widget {
        bottom: 15px;
        right: 15px;
    }

    .ai-chatbot-button {
        width: 56px;
        height: 56px;
    }

    .ai-chatbot-button svg {
        width: 24px;
        height: 24px;
    }

    .ai-chatbot-button span {
        font-size: 9px;
    }

    .ai-chatbot-window {
        bottom: 80px;
        right: 15px;
        left: 15px;
        width: auto;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
    }

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

@media (max-width: 480px) {
    .ai-chatbot-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .ai-chatbot-button {
        width: 50px;
        height: 50px;
    }

    .ai-chatbot-button span {
        display: none;
    }
}
