/* ETCOM.DZ - Floating AI Chat Widget Styles */

:root {
    --etcom-chat-primary: #ff5722;
    --etcom-chat-primary-hover: #f4511e;
    --etcom-chat-bg: #0f172a;
    --etcom-chat-surface: #1e293b;
    --etcom-chat-border: rgba(255, 255, 255, 0.1);
    --etcom-chat-text: #f8fafc;
    --etcom-chat-text-muted: #94a3b8;
    --etcom-chat-msg-user: #ff5722;
    --etcom-chat-msg-ai: #1e293b;
    --etcom-chat-radius: 18px;
    --etcom-chat-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

/* Floating Launcher Button */
#etcom-chat-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff5722, #e64a19);
    box-shadow: 0 8px 25px rgba(255, 87, 34, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999999;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#etcom-chat-launcher:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 87, 34, 0.6);
}

#etcom-chat-launcher svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
    transition: transform 0.3s ease;
}

#etcom-chat-launcher.is-open svg.icon-chat {
    display: none;
}

#etcom-chat-launcher.is-open svg.icon-close {
    display: block;
}

#etcom-chat-launcher svg.icon-close {
    display: none;
}

/* Notification badge / pulse */
#etcom-chat-launcher::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #ffffff;
    animation: etcom-pulse 2s infinite;
}

@keyframes etcom-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Chat Popup Window */
#etcom-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: var(--etcom-chat-bg);
    border-radius: var(--etcom-chat-radius);
    box-shadow: var(--etcom-chat-shadow);
    border: 1px solid var(--etcom-chat-border);
    display: flex;
    flex-direction: column;
    z-index: 999998;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.96);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

#etcom-chat-window.is-active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Header */
.etcom-chat-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 14px 18px;
    border-bottom: 1px solid var(--etcom-chat-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.etcom-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ff5722;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(255, 87, 34, 0.4);
}

.etcom-chat-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--etcom-chat-text);
    margin: 0;
    line-height: 1.2;
}

.etcom-chat-status {
    font-size: 11.5px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.etcom-chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
}

.etcom-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.etcom-chat-btn-wa-header {
    background: #25d366;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 9px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform 0.2s;
}

.etcom-chat-btn-wa-header:hover {
    transform: scale(1.05);
}

.etcom-chat-btn-close {
    background: none;
    border: none;
    color: var(--etcom-chat-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.etcom-chat-btn-close:hover {
    color: #fff;
}

/* Quick Chips Bar */
.etcom-chat-chips {
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.6);
    border-bottom: 1px solid var(--etcom-chat-border);
    display: flex;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.etcom-chat-chips::-webkit-scrollbar {
    display: none;
}

.etcom-chat-chip {
    background: rgba(255, 255, 255, 0.08);
    color: var(--etcom-chat-text);
    border: 1px solid var(--etcom-chat-border);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.etcom-chat-chip:hover {
    background: #ff5722;
    border-color: #ff5722;
    color: #fff;
}

/* Messages History Area */
.etcom-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.etcom-chat-bubble {
    max-width: 82%;
    padding: 11px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
    position: relative;
}

.etcom-chat-bubble-ai {
    align-self: flex-start;
    background: var(--etcom-chat-surface);
    color: var(--etcom-chat-text);
    border: 1px solid var(--etcom-chat-border);
    border-bottom-left-radius: 4px;
}

.etcom-chat-bubble-user {
    align-self: flex-end;
    background: var(--etcom-chat-msg-user);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.etcom-chat-bubble a {
    color: #38bdf8;
    text-decoration: underline;
    font-weight: 600;
}

.etcom-chat-bubble a.btn-wa-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #25d366;
    color: #fff !important;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    margin-top: 8px;
    font-weight: 700;
    font-size: 12.5px;
}

.etcom-chat-time {
    font-size: 9.5px;
    color: var(--etcom-chat-text-muted);
    margin-top: 4px;
    text-align: right;
}

/* Typing Indicator */
.etcom-chat-typing {
    align-self: flex-start;
    background: var(--etcom-chat-surface);
    border: 1px solid var(--etcom-chat-border);
    border-radius: 14px;
    padding: 8px 14px;
    display: none;
    align-items: center;
    gap: 4px;
}

.etcom-chat-typing.is-visible {
    display: flex;
}

.etcom-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff5722;
    animation: etcom-bounce 1.4s infinite ease-in-out both;
}

.etcom-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.etcom-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes etcom-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Area */
.etcom-chat-footer {
    padding: 12px 14px;
    background: var(--etcom-chat-surface);
    border-top: 1px solid var(--etcom-chat-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.etcom-chat-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--etcom-chat-border);
    border-radius: 20px;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
}

.etcom-chat-input:focus {
    border-color: #ff5722;
}

.etcom-chat-input::placeholder {
    color: var(--etcom-chat-text-muted);
}

.etcom-chat-btn-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ff5722;
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    flex-shrink: 0;
}

.etcom-chat-btn-send:hover {
    background: #f4511e;
    transform: scale(1.05);
}

.etcom-chat-btn-send svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
    margin-left: 2px;
}
