/* ═══════════════════════════════════════════
   UreTech Chat Simulator Widget
   Mobile-first responsive CSS
   Prefix: .ure-cs-
   ═══════════════════════════════════════════ */

/* ── Root ── */
.ure-cs-root {
    font-family: 'Outfit', sans-serif;
    position: relative;
    display: flex;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* ── Container ── */
.ure-cs-container {
    width: 100%;
    max-width: 100%;
    height: 400px;
    background: var(--cs-bg, #060510);
    border-radius: var(--cs-radius, 20px);
    border: 1px solid rgba(193, 191, 230, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(193, 191, 230, 0.06);
}

/* ── Header ── */
.ure-cs-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(193, 191, 230, 0.06);
    border-bottom: 1px solid rgba(193, 191, 230, 0.1);
    flex-shrink: 0;
}

.ure-cs-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(234, 136, 222, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ure-cs-avatar svg {
    display: block;
}

.ure-cs-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ure-cs-bot-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--cs-text, #FAFAFA);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ure-cs-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ure-cs-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4ADE80;
    box-shadow: 0 0 6px #4ADE80;
    flex-shrink: 0;
    animation: ure-cs-pulse 2s ease-in-out infinite;
}

.ure-cs-status-text {
    font-size: 10px;
    color: var(--cs-text, #FAFAFA);
    opacity: 0.5;
    font-weight: 500;
}

@keyframes ure-cs-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px #4ADE80; }
    50% { opacity: 0.5; box-shadow: 0 0 12px #4ADE80, 0 0 24px #4ADE80; }
}

/* ── Messages Area ── */
.ure-cs-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--cs-chat-bg, rgba(193, 191, 230, 0.04));
    scrollbar-width: thin;
    scrollbar-color: rgba(193, 191, 230, 0.15) transparent;
}

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

.ure-cs-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ure-cs-messages::-webkit-scrollbar-thumb {
    background: rgba(193, 191, 230, 0.15);
    border-radius: 4px;
}

/* ── Message Row ── */
.ure-cs-msg-row {
    display: flex;
    width: 100%;
}

.ure-cs-msg-row--bot {
    justify-content: flex-start;
}

.ure-cs-msg-row--user {
    justify-content: flex-end;
}

/* ── Message Bubble ── */
.ure-cs-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ure-cs-bubble--bot {
    background: var(--cs-bot-bubble, rgba(193, 191, 230, 0.12));
    color: var(--cs-text, #FAFAFA);
    border-bottom-left-radius: 4px;
}

.ure-cs-bubble--user {
    background: var(--cs-user-bubble, #EA88DE);
    color: #060510;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

/* ── Message Enter Animation ── */
.ure-cs-msg-enter {
    opacity: 0;
    transform: translateY(12px);
}

.ure-cs-msg-enter--active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Typing Indicator ── */
.ure-cs-typing {
    padding: 12px 18px;
}

.ure-cs-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 16px;
}

.ure-cs-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cs-text, #FAFAFA);
    opacity: 0.4;
    animation: ure-cs-bounce 1.4s ease-in-out infinite;
}

.ure-cs-dot:nth-child(2) {
    animation-delay: 0.16s;
}

.ure-cs-dot:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes ure-cs-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ── Input Bar (decorative) ── */
.ure-cs-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(193, 191, 230, 0.06);
    border-top: 1px solid rgba(193, 191, 230, 0.1);
    flex-shrink: 0;
}

.ure-cs-input-field {
    flex: 1;
    background: rgba(193, 191, 230, 0.08);
    border: 1px solid rgba(193, 191, 230, 0.1);
    border-radius: 100px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--cs-text, #FAFAFA);
    opacity: 0.3;
    font-family: 'Outfit', sans-serif;
    pointer-events: none;
    user-select: none;
}

.ure-cs-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(234, 136, 222, 0.15);
    border: 1px solid rgba(234, 136, 222, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    pointer-events: none;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.25s ease;
}

.ure-cs-send-btn svg {
    display: block;
}


/* ══════════════════════════════════════
   TABLET (768px+)
   Centered, max-width 420px, 480px height
   ══════════════════════════════════════ */
@media (min-width: 768px) {
    .ure-cs-root {
        padding: 24px;
    }

    .ure-cs-container {
        max-width: 420px;
        height: 480px;
    }

    .ure-cs-header {
        padding: 14px 18px;
    }

    .ure-cs-messages {
        padding: 18px;
    }

    .ure-cs-input-bar {
        padding: 12px 16px;
    }

    .ure-cs-bot-name {
        font-size: 14px;
    }
}


/* ══════════════════════════════════════
   DESKTOP (1024px+)
   max-width 480px, 520px height, hover effects
   ══════════════════════════════════════ */
@media (min-width: 1024px) {
    .ure-cs-container {
        max-width: 480px;
        height: 520px;
        transition: box-shadow 0.3s ease, border-color 0.3s ease;
    }

    .ure-cs-container:hover {
        border-color: rgba(193, 191, 230, 0.25);
        box-shadow:
            0 8px 40px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(193, 191, 230, 0.1);
    }

    .ure-cs-bubble--bot {
        transition: background 0.2s ease;
    }

    .ure-cs-bubble--bot:hover {
        background: rgba(193, 191, 230, 0.18);
    }

    .ure-cs-bubble--user {
        transition: filter 0.2s ease;
    }

    .ure-cs-bubble--user:hover {
        filter: brightness(1.08);
    }

    .ure-cs-header {
        padding: 14px 20px;
    }

    .ure-cs-messages {
        padding: 20px;
        gap: 12px;
    }

    .ure-cs-bubble {
        font-size: 14px;
        max-width: 80%;
    }
}


/* ══════════════════════════════════════
   LARGE DESKTOP (1440px+)
   max-width 520px
   ══════════════════════════════════════ */
@media (min-width: 1440px) {
    .ure-cs-container {
        max-width: 520px;
    }

    .ure-cs-bot-name {
        font-size: 15px;
    }

    .ure-cs-bubble {
        padding: 12px 16px;
        font-size: 14.5px;
    }

    .ure-cs-avatar {
        width: 40px;
        height: 40px;
    }
}


/* ══════════════════════════════════════
   REDUCED MOTION
   Instant messages, no slide, no bounce
   ══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .ure-cs-status-dot {
        animation: none;
    }

    .ure-cs-dot {
        animation: none;
        opacity: 0.6;
    }

    .ure-cs-msg-enter {
        opacity: 1;
        transform: none;
    }

    .ure-cs-msg-enter--active {
        transition: none;
    }

    .ure-cs-container,
    .ure-cs-bubble--bot,
    .ure-cs-bubble--user {
        transition: none;
    }
}
