/* ============================================
   TECHKNOW — Chat Widget Styles
   WhatsApp-inspired UI
   ============================================ */

/* ---------- Chat Window ---------- */
.cw-window {
    position: fixed;
    bottom: 100px;
    right: 28px;
    width: 380px;
    max-height: 560px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #f0ebe3;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.06);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.92);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cw-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ---------- Header ---------- */
.cw-header {
    background: #1a3c34;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.cw-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d6a4f, #40916c);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cw-header-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.cw-header-status {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 5px;
}

.cw-online-dot {
    width: 7px;
    height: 7px;
    background: #25D366;
    border-radius: 50%;
    display: inline-block;
}

.cw-header-hours {
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    letter-spacing: 0.02em;
}

.cw-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.cw-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ---------- Messages Area ---------- */
.cw-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 280px;
    max-height: 340px;
    background:
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231a3c34' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
        #f0ebe3;
}

.cw-messages::-webkit-scrollbar {
    width: 4px;
}

.cw-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.cw-date-badge {
    text-align: center;
    font-size: 0.7rem;
    color: #8696a0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    padding: 4px 12px;
    margin: 4px auto 8px;
    display: inline-block;
    align-self: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ---------- Message Bubbles ---------- */
.cw-msg {
    display: flex;
    animation: cw-msg-in 0.3s ease-out both;
}

.cw-msg-user {
    justify-content: flex-end;
}

.cw-msg-bot {
    justify-content: flex-start;
}

.cw-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    line-height: 1.55;
    font-family: 'Inter', sans-serif;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cw-bubble-user {
    background: #d9fdd3;
    color: #111b21;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cw-bubble-bot {
    background: #ffffff;
    color: #111b21;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cw-bubble strong {
    font-weight: 600;
    color: #1a3c34;
}

.cw-time {
    display: block;
    text-align: right;
    font-size: 0.62rem;
    color: #8696a0;
    margin-top: 4px;
}

@keyframes cw-msg-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- CTA Bubble (WhatsApp handoff) ---------- */
.cw-bubble-cta {
    padding: 0;
    overflow: hidden;
    background: #fff;
}

.cw-summary-preview {
    padding: 14px 16px;
    font-size: 0.82rem;
    line-height: 1.6;
    border-bottom: 1px solid #e9e9e9;
}

.cw-summary-preview strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
}

.cw-summary-preview p {
    color: #667781;
    margin: 0;
    white-space: pre-line;
}

.cw-wa-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: #25D366;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.cw-wa-btn:hover {
    background: #1ebe5a;
}

/* ---------- Typing Indicator ---------- */
.cw-typing {
    padding: 0 14px 4px;
    display: none;
}

.cw-typing.visible {
    display: block;
}

.cw-typing-dots {
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cw-typing-dots span {
    width: 6px;
    height: 6px;
    background: #8696a0;
    border-radius: 50%;
    animation: cw-dot-bounce 1.4s infinite ease-in-out;
}

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

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

@keyframes cw-dot-bounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ---------- Quick Replies ---------- */
.cw-quick-replies {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

.cw-quick-replies::-webkit-scrollbar {
    display: none;
}

.cw-quick {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 50px;
    border: 1.5px solid #1a3c34;
    background: transparent;
    color: #1a3c34;
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}

.cw-quick:hover {
    background: #1a3c34;
    color: #fff;
}

/* ---------- Input Area ---------- */
.cw-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    background: #f0ebe3;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.cw-input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 24px;
    background: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    color: #111b21;
    outline: none;
}

.cw-input::placeholder {
    color: #8696a0;
}

.cw-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #1a3c34;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.cw-send:hover {
    background: #2d6a4f;
    transform: scale(1.05);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .cw-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        height: 100vh;
    }

    .cw-messages {
        max-height: none;
        flex: 1;
    }
}