/* ============================================
   iTechOza AI Chatbot Styles
   ============================================ */

#itechoza-chatbot-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Toggle Button ---- */
#itechoza-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--itechoza-primary, #1a73e8);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s;
    color: #fff;
}
#itechoza-chat-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
#itechoza-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e53935;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid #fff;
}

/* ---- Chat Window ---- */
#itechoza-chat-window {
    width: 360px;
    max-width: calc(100vw - 32px);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    background: #fff;
    overflow: hidden;
    position: absolute;
    bottom: 72px;
    right: 0;
    display: flex;
    flex-direction: column;
    animation: itechoza-slide-up 0.25s ease;
}
@keyframes itechoza-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---- Header ---- */
#itechoza-chat-header {
    background: var(--itechoza-primary, #1a73e8);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.bot-avatar {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.bot-name {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
}
.bot-status {
    font-size: 11px;
    opacity: 0.85;
    margin-top: 2px;
    color: #a5f3a5;
}
#itechoza-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
    padding: 2px 6px;
}
#itechoza-chat-close:hover { opacity: 1; }

/* ---- Messages ---- */
#itechoza-chat-messages {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    max-height: 320px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7f9fc;
}
.itechoza-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}
.itechoza-msg.bot {
    background: #fff;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    align-self: flex-start;
    color: #222;
}
.itechoza-msg.user {
    background: var(--itechoza-primary, #1a73e8);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}
.itechoza-msg a {
    color: var(--itechoza-primary, #1a73e8);
    text-decoration: underline;
}
.itechoza-msg.user a {
    color: #fff;
}
.itechoza-typing-dots {
    display: flex;
    gap: 4px;
    padding: 8px 4px;
    align-items: center;
}
.itechoza-typing-dots span {
    width: 7px;
    height: 7px;
    background: #aaa;
    border-radius: 50%;
    animation: typing-dot 1.2s infinite;
}
.itechoza-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.itechoza-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-dot {
    0%,80%,100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ---- Quick Replies ---- */
#itechoza-quick-replies {
    padding: 6px 10px 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #f7f9fc;
    border-top: 1px solid #eee;
}
#itechoza-quick-replies:empty {
    display: none;
    padding: 0;
}
.itechoza-qr-btn {
    background: #fff;
    border: 1.5px solid var(--itechoza-primary, #1a73e8);
    color: var(--itechoza-primary, #1a73e8);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.itechoza-qr-btn:hover {
    background: var(--itechoza-primary, #1a73e8);
    color: #fff;
}

/* ---- Lead Form ---- */
#itechoza-lead-form {
    padding: 12px 14px;
    background: #f0f6ff;
    border-top: 1px solid #dce8ff;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.lead-form-title {
    font-weight: 700;
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
}
#itechoza-lead-form input,
#itechoza-lead-form textarea {
    padding: 8px 10px;
    border: 1.5px solid #d0d8e4;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
#itechoza-lead-form input:focus,
#itechoza-lead-form textarea:focus {
    border-color: var(--itechoza-primary, #1a73e8);
}
#lead-submit-btn {
    background: var(--itechoza-primary, #1a73e8);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
#lead-submit-btn:hover { opacity: 0.9; }
#lead-cancel-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    padding: 2px;
}

/* ---- Input Area ---- */
#itechoza-chat-input-area {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #eee;
    gap: 8px;
    background: #fff;
}
#itechoza-user-input {
    flex: 1;
    border: 1.5px solid #ddd;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
}
#itechoza-user-input:focus {
    border-color: var(--itechoza-primary, #1a73e8);
}
#itechoza-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--itechoza-primary, #1a73e8);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
#itechoza-send-btn:hover { opacity: 0.85; }

/* ---- Footer ---- */
#itechoza-chat-footer {
    display: flex;
    gap: 6px;
    padding: 8px 12px 10px;
    border-top: 1px solid #eee;
    background: #fafafa;
    flex-wrap: wrap;
}
.footer-btn {
    flex: 1;
    text-align: center;
    padding: 7px 6px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.footer-btn:hover { opacity: 0.85; }
.whatsapp-btn {
    background: #25d366;
    color: #fff;
}
.estimate-btn {
    background: #f59e0b;
    color: #fff;
}
.talk-btn {
    background: var(--itechoza-primary, #1a73e8);
    color: #fff;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 480px) {
    #itechoza-chatbot-wrapper {
        bottom: 16px;
        right: 12px;
    }
    #itechoza-chat-window {
        width: calc(100vw - 24px);
        right: -4px;
    }
}
