
/* BeyondBlocks Chat Widget - Modern Dark Theme */

html, body {
    background: #1a1a2e;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0 auto;
}

/* M E S S A G E S */

.chat {
    list-style: none;
    background: none;
    padding: 12px 12px 60px 12px;
    margin: 0;
}

.chat li {
    padding: 4px 0;
    font-size: 14px;
    overflow: hidden;
    display: flex;
    animation: msgIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.visitor {
    justify-content: flex-end;
    align-items: flex-end;
}

.visitor .msg {
    order: 1;
    border-bottom-right-radius: 0;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.25);
}

.admin .msg {
    order: 1;
    border-top-left-radius: 0;
    background: #2d2d44;
    color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.msg {
    word-wrap: break-word;
    min-width: 50px;
    max-width: 80%;
    padding: 10px 14px 6px;
    border-radius: 16px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.07);
}

.msg p {
    margin: 2px 0 0;
    line-height: 1.4;
}

/* S E N D E R  L A B E L */

.sender-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-bottom: 2px;
    user-select: none;
}

.visitor .sender-label {
    color: rgba(255, 255, 255, 0.7);
}

.admin .sender-label {
    color: rgba(245, 158, 11, 0.8);
}

/* T I M E */

.msg .time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 4px;
    float: right;
    cursor: default;
    user-select: none;
}

.admin .msg .time {
    color: rgba(255, 255, 255, 0.25);
}

/* S C R O L L B A R */

::-webkit-scrollbar {
    min-width: 6px;
    width: 6px;
    max-width: 6px;
    min-height: 6px;
    height: 6px;
    max-height: 6px;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.3);
    border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 158, 11, 0.5);
}

::-webkit-scrollbar-button {
    display: none;
    height: 0;
}

/* I N P U T */

input.textarea {
    position: fixed;
    bottom: 14px;
    left: 12px;
    right: 12px;
    width: calc(100% - 24px);
    height: 40px;
    z-index: 99;
    background: #2d2d44;
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 20px;
    outline: none;
    padding: 0 16px;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

input.textarea:focus {
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.1);
}

input.textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Q U I C K  R E P L I E S */

.quick-replies {
    position: fixed;
    bottom: 60px;
    left: 12px;
    right: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    z-index: 99;
    padding-bottom: 4px;
}

.quick-reply-btn {
    background: #2d2d44;
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #e0e0e0;
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    color: #f59e0b;
}

.quick-reply-btn:active {
    transform: scale(0.96);
}

/* C L E A R  H I S T O R Y */

.clear-history {
    text-align: center;
    padding: 4px 12px 2px;
}

.clear-history button {
    background: none;
    border: none;
    color: rgba(245, 158, 11, 0.6);
    font-size: 11px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    padding: 2px 8px;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.clear-history button:hover {
    color: rgba(245, 158, 11, 0.9);
}

/* S Y S T E M  M E S S A G E */

.system-message {
    justify-content: center !important;
    padding: 8px 0;
}

.system-message .msg {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 12px;
    padding: 8px 16px;
    max-width: 90%;
}

.system-message .msg p {
    font-size: 12px;
    color: rgba(245, 158, 11, 0.7);
    text-align: center;
    margin: 0;
}
