/* Support Chatbot Styles */

/* ========== THEME VARIABLES ========== */
/* Sinoz Theme - Default */
:root {
    --chatbot-primary: #A3D7C9;
    --chatbot-primary-dark: #7BC4B2;
    --chatbot-primary-light: #C5E8DF;
    --chatbot-gradient: linear-gradient(135deg, #A3D7C9, #7BC4B2);
    --chatbot-shadow: rgba(163, 215, 201, 0.4);
    --chatbot-shadow-hover: rgba(163, 215, 201, 0.5);
    --chatbot-bg-light: linear-gradient(135deg, #f0faf7 0%, #e5f5f0 100%);
    --chatbot-border-light: #c5e8df;
}

/* Bath Factory Theme */
body.theme-bathfactory,
body[data-site="bathfactory"] {
    --chatbot-primary: #FF6A08;
    --chatbot-primary-dark: #E55A00;
    --chatbot-primary-light: #FF8A3D;
    --chatbot-gradient: linear-gradient(135deg, #FF6A08, #E55A00);
    --chatbot-shadow: rgba(255, 106, 8, 0.4);
    --chatbot-shadow-hover: rgba(255, 106, 8, 0.5);
    --chatbot-bg-light: linear-gradient(135deg, #fff8f4 0%, #fff0e6 100%);
    --chatbot-border-light: #ffd4b8;
}

/* ========== CHATBOT STYLES ========== */

/* Floating Badge - Chatbot Trigger */
.support-chatbot-badge {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: var(--chatbot-gradient);
    color: #fff;
    padding: 14px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 4px 20px var(--chatbot-shadow);
    z-index: 9998;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    outline: none;
}

.support-chatbot-badge:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px var(--chatbot-shadow-hover);
}

.support-chatbot-badge i {
    font-size: 20px;
}

.support-chatbot-badge .badge-pulse {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 150px);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-container.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbot Header */
.chatbot-header {
    background: var(--chatbot-gradient);
    color: #fff;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.chatbot-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-title span {
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-close:hover {
    background: rgba(255,255,255,0.3);
}

/* Chat Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
    justify-content: flex-start;
}

.chat-message.user {
    justify-content: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-message.bot .message-avatar {
    background: var(--chatbot-gradient);
    color: #fff;
}

.chat-message.user .message-avatar {
    background: #e9ecef;
    color: #495057;
    order: 2;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.bot .message-content {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chat-message.user .message-content {
    background: var(--chatbot-gradient);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Quick Reply Buttons */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-reply-btn {
    background: #fff;
    border: 2px solid var(--chatbot-primary);
    color: var(--chatbot-primary-dark);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-reply-btn:hover {
    background: var(--chatbot-primary);
    color: #fff;
    transform: translateY(-2px);
}

.quick-reply-btn.selected {
    background: var(--chatbot-primary);
    color: #fff;
}

/* Input Form Area */
.chatbot-input-area {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #eee;
}

.chatbot-input-group {
    display: flex;
    gap: 10px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.chatbot-input:focus {
    border-color: var(--chatbot-primary);
}

.chatbot-send-btn {
    width: 45px;
    height: 45px;
    background: var(--chatbot-gradient);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-send-btn:hover {
    transform: scale(1.05);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Steps */
.chatbot-form-step {
    display: none;
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #eee;
}

.chatbot-form-step.active {
    display: block;
}

.form-step-title {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.chatbot-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.chatbot-form-input:focus {
    border-color: var(--chatbot-primary);
}

.chatbot-form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    resize: none;
    height: 80px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.chatbot-form-textarea:focus {
    border-color: var(--chatbot-primary);
}

.chatbot-form-btn {
    width: 100%;
    padding: 14px;
    background: var(--chatbot-gradient);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--chatbot-shadow);
}

.chatbot-form-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--chatbot-primary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Success State */
.chatbot-success {
    text-align: center;
    padding: 40px 20px;
}

.chatbot-success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #00b894, #00cec9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    color: #fff;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.chatbot-success h3 {
    color: #333;
    margin-bottom: 10px;
}

.chatbot-success p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.chatbot-success .ticket-number {
    background: #f8f9fa;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--chatbot-primary-dark);
    margin: 15px 0;
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .support-chatbot-badge {
        bottom: 80px;
        right: 15px;
        padding: 12px 16px;
    }

    .support-chatbot-badge span {
        display: none;
    }

    .chatbot-container {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        display: none;
        flex-direction: column;
    }

    .chatbot-container.active {
        display: flex;
    }

    /* Mobilde header sabit üstte */
    .chatbot-header {
        flex-shrink: 0;
        position: sticky;
        top: 0;
        z-index: 10;
        padding: 15px;
    }

    /* Close butonu daha belirgin */
    .chatbot-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
        background: rgba(255,255,255,0.25);
    }

    /* Mesaj alanı kalan alanı kaplasın ve scroll edilebilir olsun */
    .chatbot-messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        padding: 15px;
    }

    /* Input alanı sabit altta */
    .chatbot-input-area {
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 12px 15px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }

    /* Form step alanı da sabit altta */
    .chatbot-form-step {
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 12px 15px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
        max-height: 45vh;
        overflow-y: auto;
    }

    /* Quick reply butonları mobilde daha küçük */
    .quick-reply-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    /* Mesaj içerikleri mobilde biraz daha geniş */
    .message-content {
        max-width: 85%;
    }
}

/* Department Tag */
.department-tag {
    display: inline-block;
    background: var(--chatbot-primary-light);
    color: var(--chatbot-primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
}

/* Order Input with Validation */
.order-input-wrapper {
    position: relative;
}

.order-validation-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.order-validation-icon.valid {
    color: #00b894;
}

.order-validation-icon.invalid {
    color: #ff4757;
}

/* Skip Button */
.chatbot-skip-btn {
    background: transparent;
    border: none;
    color: #999;
    font-size: 13px;
    cursor: pointer;
    margin-top: 8px;
    text-decoration: underline;
}

.chatbot-skip-btn:hover {
    color: var(--chatbot-primary-dark);
}

/* Page Suggestion Card */
.chatbot-page-suggestion {
    background: var(--chatbot-bg-light);
    border: 1px solid var(--chatbot-border-light);
    border-radius: 16px;
    padding: 14px 16px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.page-suggestion-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    opacity: 0.15;
    pointer-events: none;
}

.page-suggestion-content {
    position: relative;
    z-index: 1;
}

.page-suggestion-content h5 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.page-suggestion-content p {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.chatbot-page-btn {
    background: var(--chatbot-gradient);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chatbot-page-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px var(--chatbot-shadow);
}

.chatbot-page-btn-secondary {
    background: #fff;
    color: var(--chatbot-primary-dark);
    border: 2px solid var(--chatbot-primary);
}

.chatbot-page-btn-secondary:hover {
    background: var(--chatbot-primary-light);
    color: var(--chatbot-primary-dark);
}

/* Info Card (for contact info display) */
.chatbot-info-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
}

.chatbot-info-card .info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: #333;
}

.chatbot-info-card .info-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.chatbot-info-card .info-item i {
    color: #667eea;
    width: 20px;
}

/* Emoji support in buttons */
.quick-reply-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}
