/* ==========================================================================
   HomeServe Chat Assistant - Urban Company Style Chatbot
   ========================================================================== */

/* Launcher Floating Button */
#hs-chat-launcher {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#hs-chat-trigger-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed 0%, #6b21a8 60%, #4c1d95 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 8px 25px rgba(107, 33, 168, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    outline: none;
}

#hs-chat-trigger-btn:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 32px rgba(107, 33, 168, 0.6);
}

#hs-chat-trigger-btn:active {
    transform: scale(0.95);
}

.hs-launcher-badge-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #10b981;
    border: 2px solid #ffffff;
    border-radius: 50%;
    animation: hsPulse 2s infinite;
}

@keyframes hsPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Callout Tooltip */
.hs-chat-callout {
    background: #ffffff;
    color: #1f2937;
    padding: 10px 16px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    max-width: 260px;
    position: relative;
    cursor: pointer;
    animation: hsFadeSlideIn 0.4s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-chat-callout-close {
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    margin-left: 4px;
    border: none;
    background: none;
    padding: 2px;
    line-height: 1;
}

.hs-chat-callout-close:hover {
    color: #4b5563;
}

@keyframes hsFadeSlideIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Chat Widget Container */
#hs-chat-box {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 400px;
    max-width: calc(100vw - 30px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
    display: none;
    flex-direction: column;
    z-index: 99999;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: hsBoxOpen 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes hsBoxOpen {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat Header */
.hs-chat-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #6b21a8 100%);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.hs-chat-avatar-wrap {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
    flex-shrink: 0;
}

.hs-avatar-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    border: 1.5px solid #ffffff;
}

.hs-chat-header-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.hs-chat-header-info span {
    font-size: 11px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 5px;
}

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

.hs-header-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.2s;
    outline: none;
}

.hs-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Area */
.hs-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.hs-chat-messages::-webkit-scrollbar {
    width: 6px;
}
.hs-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Message Rows */
.hs-msg-row {
    display: flex;
    gap: 8px;
    max-width: 90%;
    animation: hsMsgFade 0.25s ease;
}

@keyframes hsMsgFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.hs-msg-row.bot {
    align-self: flex-start;
}

.hs-msg-row.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.hs-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ede9fe;
    color: #6b21a8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    margin-top: 2px;
}

.hs-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.45;
    position: relative;
    word-break: break-word;
}

.hs-msg-row.bot .hs-msg-bubble {
    background: #ffffff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.hs-msg-row.user .hs-msg-bubble {
    background: #6b21a8;
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 6px rgba(107, 33, 168, 0.25);
}

.hs-msg-time {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
    display: block;
    text-align: right;
}

.hs-msg-row.user .hs-msg-time {
    color: rgba(255, 255, 255, 0.7);
}

/* Typing Indicator */
.hs-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    width: fit-content;
}

.hs-typing-dot {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: hsTypingBounce 1.3s infinite;
}

.hs-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.hs-typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* Quick Action Chips & Pills */
.hs-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.hs-chip-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    outline: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.hs-chip-btn:hover {
    background: #f1f5f9;
    color: #6b21a8;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.hs-chip-btn.active, .hs-chip-btn-primary {
    background: #ede9fe;
    color: #6b21a8;
    border-color: #c4b5fd;
}

.hs-chip-btn-primary:hover {
    background: #ddd6fe;
}

/* Interactive Category Cards */
.hs-cat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.hs-cat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}

.hs-cat-card:hover {
    border-color: #7c3aed;
    background: #faf5ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(107, 33, 168, 0.08);
}

.hs-cat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #ede9fe;
    color: #6b21a8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.hs-cat-name {
    font-size: 12px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

/* Service Card List */
.hs-svc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.hs-svc-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.hs-svc-card:hover {
    border-color: #7c3aed;
    box-shadow: 0 4px 12px rgba(107, 33, 168, 0.08);
}

.hs-svc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.hs-svc-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.hs-svc-price {
    font-size: 14px;
    font-weight: 800;
    color: #6b21a8;
    white-space: nowrap;
}

.hs-svc-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
}

.hs-svc-btn {
    width: 100%;
    padding: 7px 12px;
    background: #6b21a8;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.hs-svc-btn:hover {
    background: #581c87;
}

/* Order Summary Card */
.hs-card-summary {
    background: #ffffff;
    border: 1px solid #c4b5fd;
    border-radius: 14px;
    padding: 14px;
    margin-top: 8px;
    box-shadow: 0 4px 14px rgba(107, 33, 168, 0.08);
}

.hs-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    margin-bottom: 6px;
    color: #475569;
}

.hs-summary-row.total {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    border-top: 1px dashed #cbd5e1;
    padding-top: 8px;
    margin-top: 8px;
}

/* Worker Verification Card */
.hs-worker-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.hs-worker-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.hs-worker-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ede9fe;
    color: #6b21a8;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #7c3aed;
    flex-shrink: 0;
}

.hs-worker-name {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.hs-badge-pill {
    display: inline-block;
    padding: 2px 7px;
    font-size: 10px;
    font-family: monospace;
    font-weight: 700;
    border-radius: 4px;
    background: #1e1b4b;
    color: #ffffff;
}

.hs-verify-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

.hs-verify-tag.approved {
    background: #dcfce7;
    color: #15803d;
}

.hs-verify-tag.pending {
    background: #fef9c3;
    color: #854d0e;
}

.hs-verify-tag.suspended {
    background: #fee2e2;
    color: #b91c1c;
}

/* Status Card */
.hs-status-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.hs-status-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.hs-otp-box {
    background: #fef3c7;
    border: 1px dashed #f59e0b;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #92400e;
}

.hs-otp-code {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #b45309;
}

/* Input Form Controls inside chat */
.hs-form-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    background: #ffffff;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.hs-form-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.hs-form-input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

.hs-form-btn {
    padding: 8px 12px;
    background: #6b21a8;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.hs-form-btn:hover {
    background: #581c87;
}

/* Chat Footer / Input Bar */
.hs-chat-footer {
    padding: 10px 14px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hs-chat-reset-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    outline: none;
}

.hs-chat-reset-btn:hover {
    color: #6b21a8;
    background: #f1f5f9;
}

.hs-chat-input-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

#hs-chat-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    background: #f8fafc;
}

#hs-chat-input:focus {
    border-color: #7c3aed;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

#hs-chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #6b21a8;
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
    flex-shrink: 0;
}

#hs-chat-send-btn:hover {
    background: #581c87;
    transform: scale(1.05);
}

#hs-chat-send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Mobile View */
@media (max-width: 480px) {
    #hs-chat-box {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    #hs-chat-launcher {
        bottom: 15px;
        right: 15px;
    }
}

