/* =============================================
   Chatbot Widget Styles - Modern Design
   Primary: #1a2744 | Accent: #FF6B35
   ============================================= */

/* ----- Chat Toggle Button ----- */
.chatbot-toggle {
    position: fixed;
    right: 24px;
    bottom: 100px;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: linear-gradient(135deg, #FF6B35, #ff8c5a);
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(255, 107, 53, 0.45);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    animation: chatbot-pulse 3s infinite;
}
.chatbot-toggle:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.6);
}
.chatbot-toggle i {
    color: #fff;
    font-size: 28px;
    transition: transform 0.3s;
}
.chatbot-toggle.active i {
    transform: rotate(180deg);
}
@keyframes chatbot-pulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(255,107,53,0.45); }
    50% { box-shadow: 0 6px 32px rgba(255,107,53,0.7); }
}

/* ----- Chat Window ----- */
.chatbot-window {
    position: fixed;
    right: 24px;
    bottom: 180px;
    width: 420px;
    height: 600px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.08);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px) scale(0.92);
    transition: all 0.35s cubic-bezier(.4,0,.2,1);
}
.chatbot-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ----- Header ----- */
.chatbot-header {
    background: linear-gradient(135deg, #1a2744, #243560);
    color: #fff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}
.chatbot-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #FF6B35, #ff8c5a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    flex-shrink: 0;
}
.chatbot-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}
.chatbot-header-text span {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 4px;
}
.chatbot-header-text span::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
}
.chatbot-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.chatbot-close:hover {
    background: rgba(255,255,255,0.2);
}

/* ----- Messages Area ----- */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8f9fc;
}
.chatbot-messages::-webkit-scrollbar { width: 4px; }
.chatbot-messages::-webkit-scrollbar-track { background: transparent; }
.chatbot-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ----- Message Bubbles ----- */
.chatbot-msg {
    max-width: 82%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-line;
    animation: chatbot-fadeIn 0.3s ease;
}
.chatbot-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e8ecf0;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.chatbot-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #FF6B35, #ff8040);
    color: #fff;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 8px rgba(255,107,53,0.25);
}

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

/* ----- Typing Indicator ----- */
.chatbot-typing {
    align-self: flex-start;
    display: flex;
    gap: 5px;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    animation: chatbot-fadeIn 0.3s;
}
.chatbot-typing span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: chatbot-bounce 1.4s infinite ease-in-out;
}
.chatbot-typing span:nth-child(1) { animation-delay: 0s; }
.chatbot-typing span:nth-child(2) { animation-delay: 0.16s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.32s; }
@keyframes chatbot-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-10px); opacity: 1; }
}

/* ----- Input Area ----- */
.chatbot-input-area {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    border-top: 1px solid #f0f2f5;
    background: #fff;
    gap: 10px;
    flex-shrink: 0;
}
.chatbot-input-area .chatbot-input {
    flex: 1;
    border: 2px solid #e8ecf0;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s;
    background: #f8f9fc;
    color: #1e293b;
    font-family: inherit;
}
.chatbot-input-area .chatbot-input::placeholder { color: #94a3b8; }
.chatbot-input-area .chatbot-input:focus {
    border-color: #FF6B35;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}
.chatbot-input-area .chatbot-send {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #FF6B35, #ff8040);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255,107,53,0.3);
}
.chatbot-input-area .chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255,107,53,0.4);
}

/* ----- Price Card ----- */
.chatbot-price-card {
    align-self: flex-start;
    background: linear-gradient(135deg, #1a2744, #243560);
    border-radius: 18px;
    padding: 24px;
    color: #fff;
    max-width: 90%;
    animation: chatbot-fadeIn 0.4s;
    box-shadow: 0 4px 16px rgba(26,39,68,0.25);
}
.chatbot-price-card .price-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
    margin-bottom: 6px;
}
.chatbot-price-card .price-amount {
    font-size: 32px;
    font-weight: 800;
    color: #FF6B35;
    margin-bottom: 4px;
}
.chatbot-price-card .price-note {
    font-size: 13px;
    opacity: 0.6;
    margin-bottom: 18px;
}
.chatbot-price-card .price-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.chatbot-price-card .price-wa-btn,
.chatbot-price-card .price-form-btn {
    padding: 10px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    cursor: pointer;
}
.chatbot-price-card .price-wa-btn {
    background: #25D366;
    color: #fff;
}
.chatbot-price-card .price-wa-btn:hover { background: #1da851; }
.chatbot-price-card .price-form-btn {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}
.chatbot-price-card .price-form-btn:hover { background: rgba(255,255,255,0.25); }

/* ----- Option Buttons ----- */
.chatbot-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-self: flex-start;
    max-width: 88%;
    animation: chatbot-fadeIn 0.3s;
}
.chatbot-option-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e8ecf0;
    border-radius: 14px;
    background: #fff;
    color: #1e293b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    font-family: inherit;
}
.chatbot-option-btn:hover {
    border-color: #FF6B35;
    background: linear-gradient(135deg, rgba(255,107,53,0.06), rgba(255,107,53,0.02));
    color: #FF6B35;
    transform: translateX(4px);
}
.chatbot-option-btn:active {
    transform: scale(0.98);
    background: #FF6B35;
    color: #fff;
    border-color: #FF6B35;
}

/* ----- Phone / SMS Forms ----- */
.chatbot-phone-form,
.chatbot-code-form {
    align-self: flex-start;
    background: #fff;
    border: 2px solid #e8ecf0;
    border-radius: 18px;
    padding: 20px;
    max-width: 90%;
    animation: chatbot-fadeIn 0.3s;
}
.chatbot-phone-form p,
.chatbot-code-form p {
    font-size: 14px;
    color: #475569;
    margin: 0 0 14px;
    line-height: 1.5;
}
.chatbot-phone-input,
.chatbot-code-input {
    width: 100%;
    border: 2px solid #e8ecf0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
    margin-bottom: 12px;
    font-family: inherit;
    letter-spacing: 0.5px;
}
.chatbot-phone-input:focus,
.chatbot-code-input:focus {
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}
.chatbot-code-input {
    font-size: 24px;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 700;
}
.chatbot-phone-btn,
.chatbot-code-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #FF6B35, #ff8040);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
}
.chatbot-phone-btn:hover,
.chatbot-code-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}
.chatbot-phone-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.chatbot-phone-edit {
    width: 100%;
    padding: 10px;
    border: 2px solid #e8ecf0;
    border-radius: 12px;
    background: #fff;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.chatbot-phone-edit:hover {
    border-color: #FF6B35;
    color: #FF6B35;
}

/* ----- Close Confirmation ----- */
.chatbot-confirm {
    position: absolute;
    inset: 0;
    background: rgba(26,39,68,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: chatbot-fadeIn 0.2s;
    border-radius: 24px;
    padding: 32px;
    text-align: center;
}
.chatbot-confirm p {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 24px;
    line-height: 1.5;
}
.chatbot-confirm-btns {
    display: flex;
    gap: 12px;
}
.chatbot-confirm-btns button {
    padding: 12px 32px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.chatbot-confirm-yes {
    background: #ef4444;
    color: #fff;
}
.chatbot-confirm-yes:hover { background: #dc2626; }
.chatbot-confirm-no {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25) !important;
}
.chatbot-confirm-no:hover { background: rgba(255,255,255,0.25); }

/* ----- Ekspertiz Form ----- */
.chatbot-ekspertiz {
    align-self: flex-start;
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border: 2px solid #bbf7d0;
    border-radius: 18px;
    padding: 20px;
    max-width: 90%;
    animation: chatbot-fadeIn 0.3s;
}
.chatbot-ekspertiz p { margin: 0 0 6px; font-size: 15px; color: #1e293b; }
.chatbot-ekspertiz .ekspertiz-desc { font-size: 13px; color: #64748b; margin-bottom: 14px; }
.ekspertiz-input {
    width: 100%;
    border: 2px solid #d1fae5;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 15px;
    outline: none;
    margin-bottom: 8px;
    font-family: inherit;
    transition: border-color 0.2s;
}
.ekspertiz-input:focus { border-color: #10b981; }
.ekspertiz-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: #10b981;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s;
}
.ekspertiz-btn:hover { background: #059669; }
.ekspertiz-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ekspertiz-skip {
    width: 100%;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.ekspertiz-skip:hover { border-color: #d1d5db; color: #374151; }
.ekspertiz-success {
    color: #059669;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

/* ----- Error / Info Messages ----- */
.chatbot-error {
    align-self: center;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    text-align: center;
    max-width: 90%;
    animation: chatbot-fadeIn 0.3s;
}

/* ----- Turnstile Container ----- */
.chatbot-turnstile {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

/* ----- First Visit Promo Popup ----- */
.chatbot-promo {
    position: fixed;
    right: 24px;
    bottom: 175px;
    z-index: 9998;
    animation: chatbot-fadeIn 0.4s;
}
.chatbot-promo-content {
    background: #fff;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    position: relative;
    max-width: 260px;
    border: 2px solid #FF6B35;
}
.chatbot-promo-content::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 30px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #FF6B35;
}
.chatbot-promo-content p {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}
.chatbot-promo-close {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
}
.chatbot-promo-close:hover { color: #1e293b; }
.chatbot-promo-btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #FF6B35, #ff8040);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.chatbot-promo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

/* ----- Turnstile in Chat ----- */
.chatbot-turnstile-wrap {
    align-self: center;
    text-align: center;
    animation: chatbot-fadeIn 0.3s;
    padding: 8px;
}

/* ----- Mobile Responsive ----- */
@media (max-width: 480px) {
    .chatbot-window {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
        max-height: 100dvh;
    }
    .chatbot-toggle {
        right: 16px;
        bottom: 80px;
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }
    .chatbot-toggle i { font-size: 24px; }
    .chatbot-header { padding: 16px 18px; }
    .chatbot-messages { padding: 16px 14px; }
    .chatbot-msg { font-size: 15px; max-width: 88%; }
    .chatbot-input-area { padding: 12px 14px; }
    .chatbot-confirm { border-radius: 0; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .chatbot-window {
        right: 12px;
        bottom: 170px;
        width: calc(100vw - 24px);
        max-width: 420px;
        height: 560px;
    }
}
