/* ─── EvoTech AI Chat Widget Styles ─── */

/* Chat Bubble Button */
#evotech-chat-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f8ef7 0%, #6c5ce7 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 999999;
    box-shadow: 0 4px 20px rgba(79, 142, 247, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 28px;
}
#evotech-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(79, 142, 247, 0.6);
}
#evotech-chat-bubble.has-unread::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid #1a1a2e;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Chat Panel */
#evotech-chat-panel {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 140px);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(79, 142, 247, 0.2);
    border-radius: 16px;
    z-index: 999998;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#evotech-chat-panel.open {
    display: flex;
}

/* Header */
.evotech-chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(79, 142, 247, 0.15), rgba(108, 92, 231, 0.15));
    border-bottom: 1px solid rgba(79, 142, 247, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
}
.evotech-chat-header .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f8ef7, #6c5ce7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.evotech-chat-header .info {
    flex: 1;
    min-width: 0;
}
.evotech-chat-header .info .name {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}
.evotech-chat-header .info .status {
    font-size: 11px;
    color: #2ed573;
    display: flex;
    align-items: center;
    gap: 4px;
}
.evotech-chat-header .info .status::before {
    content: "";
    width: 6px;
    height: 6px;
    background: #2ed573;
    border-radius: 50%;
    display: inline-block;
}
.evotech-chat-header .close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
}
.evotech-chat-header .close-btn:hover { color: #fff; }

/* Messages Area */
.evotech-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}
.evotech-chat-messages::-webkit-scrollbar {
    width: 4px;
}
.evotech-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.evotech-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(79, 142, 247, 0.3);
    border-radius: 4px;
}

/* Message Bubbles */
.evotech-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: msg-in 0.3s ease;
}
@keyframes msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.evotech-msg.bot {
    align-self: flex-start;
    background: rgba(255,255,255,0.08);
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}
.evotech-msg.user {
    align-self: flex-end;
    background: rgba(79, 142, 247, 0.25);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.evotech-msg.typing {
    background: rgba(255,255,255,0.05);
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}
.evotech-msg.typing .dot {
    width: 6px;
    height: 6px;
    background: #4f8ef7;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite;
}
.evotech-msg.typing .dot:nth-child(2) { animation-delay: 0.2s; }
.evotech-msg.typing .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

.evotech-msg.error {
    background: rgba(255,71,87,0.15);
    color: #ff6b81;
    border: 1px solid rgba(255,71,87,0.3);
}

/* Product Card */
.evotech-product-card {
    align-self: flex-start;
    width: 100%;
    max-width: 280px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(79,142,247,0.2);
    border-radius: 12px;
    padding: 14px;
    margin: 4px 0;
    animation: msg-in 0.3s ease;
}
.evotech-product-card .name {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    margin-bottom: 4px;
}
.evotech-product-card .price {
    color: #4f8ef7;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
}
.evotech-product-card .desc {
    color: #aaa;
    font-size: 12px;
    margin-bottom: 10px;
    line-height: 1.4;
}
.evotech-product-card .add-to-cart {
    display: inline-block;
    background: linear-gradient(135deg, #4f8ef7, #6c5ce7);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-align: center;
}
.evotech-product-card .add-to-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,142,247,0.4);
}

/* Service Card */
.evotech-service-card {
    align-self: flex-start;
    width: 100%;
    max-width: 280px;
    background: rgba(108,92,231,0.08);
    border: 1px solid rgba(108,92,231,0.25);
    border-radius: 12px;
    padding: 14px;
    margin: 4px 0;
    animation: msg-in 0.3s ease;
}
.evotech-service-card .name {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    margin-bottom: 4px;
}
.evotech-service-card .price {
    color: #a29bfe;
    font-size: 13px;
    margin-bottom: 8px;
}
.evotech-service-card .desc {
    color: #aaa;
    font-size: 12px;
    line-height: 1.4;
}

/* Input Area */
.evotech-chat-input {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 8px;
    align-items: center;
}
.evotech-chat-input input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px 14px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: border 0.2s;
}
.evotech-chat-input input:focus {
    border-color: #4f8ef7;
}
.evotech-chat-input input::placeholder {
    color: #666;
}
.evotech-chat-input .send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f8ef7, #6c5ce7);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.evotech-chat-input .send-btn:hover {
    transform: scale(1.05);
}
.evotech-chat-input .send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #evotech-chat-panel {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
    #evotech-chat-bubble {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
        font-size: 24px;
    }
}
