/**
 * DMOS Sales Assistant Chat Engine - Storefront Concierge Styles
 *
 * Luxury editorial aesthetic aligned with MY FASHION - AI Native Theme.
 */

:root {
    --dmos-sa-bg: #0f172a;
    --dmos-sa-surface: #1e293b;
    --dmos-sa-card: #ffffff;
    --dmos-sa-gold: #d4af37;
    --dmos-sa-gold-dark: #b5891c;
    --dmos-sa-text: #0f172a;
    --dmos-sa-muted: #64748b;
    --dmos-sa-border: #e2e8f0;
    --dmos-sa-success: #15803d;
}

/* Floating Launcher Button - Green Chat Icon */
.dmos-sa-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99998;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.42), 0 4px 10px rgba(15, 23, 42, 0.22);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.dmos-sa-launcher:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 28px rgba(22, 163, 74, 0.52), 0 6px 14px rgba(15, 23, 42, 0.25);
    background: linear-gradient(135deg, #28d666 0%, #15803d 100%);
}

.dmos-sa-launcher:active {
    transform: translateY(0) scale(0.96);
}

.dmos-sa-chat-svg {
    display: block;
    width: 28px;
    height: 28px;
    fill: #ffffff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.dmos-sa-close-svg {
    display: none;
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.dmos-sa-launcher.is-active {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.45);
}

.dmos-sa-launcher.is-active:hover {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.dmos-sa-launcher.is-active .dmos-sa-chat-svg {
    display: none;
}

.dmos-sa-launcher.is-active .dmos-sa-close-svg {
    display: block;
}

.dmos-sa-launcher-dot {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #ffffff;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
}

.dmos-sa-launcher.offline {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: 0 8px 20px rgba(71, 85, 105, 0.35);
}

.dmos-sa-launcher.offline:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    box-shadow: 0 10px 24px rgba(71, 85, 105, 0.45);
}

.dmos-sa-launcher.offline .dmos-sa-launcher-dot {
    background: #ef4444;
    border-color: #ffffff;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

.dmos-sa-launcher-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--dmos-sa-gold, #d4af37);
    color: #0f172a;
    font-size: 11px;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 999px;
    padding: 0 5px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Chat Window Panel */
.dmos-sa-window {
    position: fixed;
    bottom: 86px;
    right: 24px;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: 650px;
    max-height: calc(100vh - 110px);
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
    z-index: 99999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.dmos-sa-window.open {
    display: flex;
}

/* Header */
.dmos-sa-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #ffffff;
    padding: 13px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    gap: 10px;
}

.dmos-sa-header-person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.dmos-sa-avatar-wrap {
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.dmos-sa-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37 0%, #b5891c 100%);
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.dmos-sa-avatar-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #0f172a;
}

.dmos-sa-avatar-status.away {
    background: #f59e0b;
}

.dmos-sa-header-meta {
    min-width: 0;
}

.dmos-sa-header-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dmos-sa-header-sub {
    font-size: 11px;
    color: #d4af37;
    margin-top: 1px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dmos-sa-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.dmos-sa-bio-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.45);
    color: #f8fafc;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dmos-sa-bio-btn:hover {
    background: rgba(212, 175, 55, 0.25);
    color: #ffffff;
}

/* Collapsible Human Stylist Profile Drawer */
.dmos-sa-profile-drawer {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.35);
    font-size: 12px;
    line-height: 1.5;
    max-height: 290px;
    overflow-y: auto;
}

.dmos-sa-profile-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dmos-sa-profile-name {
    font-size: 14px;
    color: #d4af37;
    display: block;
}

.dmos-sa-profile-role {
    font-size: 11px;
    color: #cbd5e1;
}

.dmos-sa-profile-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.dmos-sa-profile-section {
    margin-bottom: 7px;
    color: #e2e8f0;
    font-size: 11.5px;
}

.dmos-sa-profile-section strong {
    color: #d4af37;
}

.dmos-sa-profile-quote {
    margin: 8px 0;
    padding: 7px 10px;
    background: rgba(212, 175, 55, 0.1);
    border-left: 2px solid #d4af37;
    border-radius: 4px;
    font-style: italic;
    color: #f8fafc;
    font-size: 11.5px;
}

.dmos-sa-profile-actions {
    margin-top: 8px;
}

.dmos-sa-profile-ask-btn {
    width: 100%;
    padding: 7px 10px;
    border-radius: 7px;
    border: 1px solid rgba(212, 175, 55, 0.55);
    background: rgba(212, 175, 55, 0.16);
    color: #d4af37;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dmos-sa-profile-ask-btn:hover {
    background: rgba(212, 175, 55, 0.28);
}

.dmos-sa-cart-pill {
    background: rgba(212, 175, 55, 0.18);
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #d4af37;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dmos-sa-cart-pill:hover {
    background: rgba(212, 175, 55, 0.32);
}

.dmos-sa-new-session-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
}

.dmos-sa-new-session-btn:hover {
    background: #22c55e;
    border-color: #22c55e;
    color: #ffffff;
    transform: rotate(90deg) scale(1.12);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.dmos-sa-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.15s ease;
}

.dmos-sa-close-btn:hover {
    color: #ffffff;
}

/* Messages Stream */
.dmos-sa-messages {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dmos-sa-msg-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dmos-sa-line {
    animation: dmosSaLineIn 0.22s ease-out both;
}

.dmos-sa-line-spacer {
    height: 4px;
}

.dmos-sa-card-in {
    animation: dmosSaLineIn 0.28s ease-out both;
}

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

.dmos-sa-msg {
    max-width: 88%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}

.dmos-sa-msg.user {
    align-self: flex-end;
    background: #0f172a;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.dmos-sa-msg.assistant {
    align-self: flex-start;
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.dmos-sa-msg-sender {
    font-size: 10.5px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    letter-spacing: 0.01em;
}

.dmos-sa-msg-sender span {
    font-weight: 600;
    color: #b5891c;
}

/* Human Typing Indicator */
.dmos-sa-typing-row {
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-top: 2px;
}

.dmos-sa-msg-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37, #b5891c);
    color: #0f172a;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dmos-sa-typing-bubble {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #64748b;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.dmos-sa-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.dmos-sa-typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d4af37;
    display: inline-block;
    animation: dmosSaTypingBounce 1.3s infinite ease-in-out both;
}

.dmos-sa-typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.dmos-sa-typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dmosSaTypingBounce {
    0%, 80%, 100% {
        transform: scale(0.4);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.dmos-sa-msg.unrelated {
    border-left: 3px solid #f59e0b;
}

/* Product Cards Carousel / Stack in Chat */
.dmos-sa-products-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
    width: 100%;
}

.dmos-sa-prod-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 11px;
    display: flex;
    gap: 12px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.dmos-sa-prod-img {
    width: 78px;
    height: 96px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
    flex-shrink: 0;
}

.dmos-sa-prod-body {
    flex: 1;
    min-width: 0;
}

.dmos-sa-prod-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px;
    text-decoration: none;
    display: block;
}

.dmos-sa-prod-price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.dmos-sa-prod-price {
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.dmos-sa-prod-reg {
    font-size: 11.5px;
    color: #94a3b8;
    text-decoration: line-through;
}

.dmos-sa-prod-gst {
    font-size: 10px;
    background: #f1f5f9;
    color: #475569;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Size & Color Selectors on Card */
.dmos-sa-opt-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
    align-items: center;
}

.dmos-sa-opt-pill {
    font-size: 10.5px;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    font-weight: 600;
}

.dmos-sa-opt-pill.active {
    background: #0f172a;
    color: #d4af37;
    border-color: #0f172a;
}

.dmos-sa-prod-btns {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.dmos-sa-btn-cart,
.dmos-sa-btn-buy {
    flex: 1;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    border: none;
}

.dmos-sa-btn-cart {
    background: #f1f5f9;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.dmos-sa-btn-buy {
    background: linear-gradient(135deg, #d4af37, #b5891c);
    color: #0f172a;
}

/* Collection Cards */
.dmos-sa-col-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.dmos-sa-col-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: border-color 0.15s;
}

.dmos-sa-col-card:hover {
    border-color: #0f172a;
}

/* Inline Checkout Form Card */
.dmos-sa-checkout-card {
    background: #ffffff;
    border: 1.5px solid #0f172a;
    border-radius: 12px;
    padding: 14px;
    margin-top: 6px;
}

.dmos-sa-checkout-card h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #0f172a;
}

.dmos-sa-chk-input,
.dmos-sa-chk-select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 12.5px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.dmos-sa-chk-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.dmos-sa-chk-submit {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #d4af37;
    border: 1px solid #d4af37;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    margin-top: 4px;
}

/* Payment Gateway Launcher Card */
.dmos-sa-pay-card {
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #d4af37;
    border-radius: 12px;
    padding: 15px;
    margin-top: 6px;
}

.dmos-sa-pay-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, #d4af37, #b5891c);
    color: #0f172a;
    border: none;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    margin-top: 10px;
}

/* Order Confirmation & Receipt Card (Sequence Closer) */
.dmos-sa-receipt-card {
    background: #f0fdf4;
    border: 1.5px solid #16a34a;
    border-radius: 12px;
    padding: 15px;
    margin-top: 6px;
    color: #0f172a;
}

.dmos-sa-receipt-badge {
    display: inline-block;
    background: #16a34a;
    color: #ffffff;
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    margin-bottom: 6px;
}

/* Quick Reply Chips */
.dmos-sa-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
    background: #f1f5f9;
    border-top: 1px solid #e2e8f0;
}

.dmos-sa-chip {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 11.5px;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: all 0.15s;
}

.dmos-sa-chip:hover {
    background: #0f172a;
    color: #d4af37;
    border-color: #0f172a;
}

/* Input Bar */
.dmos-sa-input-bar {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.dmos-sa-input {
    flex: 1;
    padding: 10px 13px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font-size: 13px;
    outline: none;
}

.dmos-sa-input:focus {
    border-color: #0f172a;
}

.dmos-sa-send-btn {
    background: #0f172a;
    color: #d4af37;
    border: none;
    border-radius: 999px;
    padding: 0 18px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .dmos-sa-launcher {
        bottom: 18px;
        right: 18px;
        width: 50px;
        height: 50px;
    }
    .dmos-sa-chat-svg {
        width: 25px;
        height: 25px;
    }
    .dmos-sa-close-svg {
        width: 22px;
        height: 22px;
    }
    .dmos-sa-window {
        bottom: 76px;
        right: 16px;
        width: calc(100vw - 32px);
        height: calc(100vh - 96px);
    }
}

