/**
 * DEPN SmartChat — inline chat styles
 * Designed to fill an Elementor popup container
 */

/* ── Container ───────────────────────────────────── */

#dsc-chat-wrap,
#dsc-chat-wrap * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

#dsc-chat-wrap {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 480px;
    max-height: 70vh;
    min-height: 360px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
}

/* ── Header ──────────────────────────────────────── */

#dsc-header {
    background: var(--dsc-primary, #1a56db);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.dsc-header-left {
    display: flex;
    align-items: center;
    gap: 11px;
}

.dsc-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
}

.dsc-header-name {
    font-weight: 600;
    font-size: 14px;
}

.dsc-header-status {
    font-size: 11px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dsc-dot {
    width: 6px;
    height: 6px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
}

/* ── Messages ────────────────────────────────────── */

#dsc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

#dsc-messages::-webkit-scrollbar {
    width: 5px;
}
#dsc-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.dsc-msg {
    display: flex;
    max-width: 88%;
    animation: dsc-fadeIn 0.2s ease;
}

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

.dsc-msg-bot { align-self: flex-start; }
.dsc-msg-user { align-self: flex-end; }

.dsc-bubble {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    word-wrap: break-word;
}

.dsc-bubble-bot {
    background: #fff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.dsc-bubble-user {
    background: var(--dsc-primary, #1a56db);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.dsc-bubble a {
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
}

.dsc-bubble-bot a {
    color: var(--dsc-primary, #1a56db);
}

/* ── Phone CTA ───────────────────────────────────── */

.dsc-phone-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: #16a34a;
    color: #fff !important;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.15s;
}

.dsc-phone-btn:hover {
    background: #15803d;
}

/* ── Typing Indicator ────────────────────────────── */

#dsc-typing {
    padding: 0 16px 6px;
}

.dsc-typing-dots {
    display: inline-flex;
    gap: 4px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

.dsc-typing-dots span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: dsc-bounce 1.4s ease-in-out infinite;
}

.dsc-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.dsc-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dsc-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

/* ── Input Area ──────────────────────────────────── */

#dsc-input-area {
    padding: 10px 12px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: #fff;
    flex-shrink: 0;
}

#dsc-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 13.5px;
    line-height: 1.4;
    resize: none;
    outline: none;
    max-height: 100px;
    background: #f9fafb;
    font-family: inherit;
    transition: border-color 0.15s;
}

#dsc-input:focus {
    border-color: var(--dsc-primary, #1a56db);
    background: #fff;
}

#dsc-input::placeholder {
    color: #94a3b8;
}

#dsc-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--dsc-primary, #1a56db);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.15s;
}

#dsc-send:hover { opacity: 0.9; }
#dsc-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Utility ─────────────────────────────────────── */

.dsc-hidden { display: none !important; }

/* ── Mobile ──────────────────────────────────────── */

@media (max-width: 480px) {
    #dsc-chat-wrap {
        height: 400px;
        min-height: 300px;
        border-radius: 8px;
    }

    .dsc-bubble {
        font-size: 13px;
    }

    .dsc-msg {
        max-width: 92%;
    }
}
