/**
 * Live Chat Widget Styles
 * File: assets/css/live-chat.css
 */

#live-chat-widget {
    --lc-primary: #1a56db;
    --lc-primary-hover: #1e40af;
    --lc-bg: #ffffff;
    --lc-border: #e5e7eb;
    --lc-text: #1f2937;
    --lc-muted: #6b7280;
    --lc-user-bg: #1a56db;
    --lc-user-text: #ffffff;
    --lc-admin-bg: #f3f4f6;
    --lc-admin-text: #1f2937;
    --lc-radius: 12px;
    --lc-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);

    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

/* Toggle Button */
.lc-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--lc-primary);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(26, 86, 219, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.lc-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(26, 86, 219, 0.45);
}

.lc-toggle--active {
    transform: scale(0.9);
}

/* Notification Badge */
.lc-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* Chat Panel */
.lc-panel {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 340px;
    max-width: calc(100vw - 40px);
    height: 380px;
    max-height: calc(100vh - 180px);
    background: var(--lc-bg);
    border-radius: var(--lc-radius);
    box-shadow: var(--lc-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 1;
    transform: translateY(0);
}

.lc-panel--closed {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Header */
.lc-header {
    background: var(--lc-primary);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.lc-header__title {
    font-weight: 600;
    font-size: 15px;
}

.lc-header__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
    padding: 0 4px;
}

.lc-header__close:hover {
    opacity: 1;
}

/* Messages */
.lc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lc-msg {
    max-width: 80%;
    animation: lcFadeIn 0.2s ease;
}

.lc-msg span {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
}

.lc-msg--user {
    align-self: flex-end;
}

.lc-msg--user span {
    background: var(--lc-user-bg);
    color: var(--lc-user-text);
    border-bottom-right-radius: 4px;
}

.lc-msg--admin {
    align-self: flex-start;
}

.lc-msg--admin span {
    background: var(--lc-admin-bg);
    color: var(--lc-admin-text);
    border-bottom-left-radius: 4px;
}

/* Input Area */
.lc-input {
    display: flex;
    align-items: center;
    padding: 12px;
    border-top: 1px solid var(--lc-border);
    gap: 8px;
    flex-shrink: 0;
}

.lc-input__field {
    flex: 1;
    border: 1px solid var(--lc-border);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.lc-input__field:focus {
    border-color: var(--lc-primary);
}

.lc-input__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--lc-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.lc-input__btn:hover {
    background: var(--lc-primary-hover);
}

@keyframes lcFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Mobile responsive */
@media (max-width: 480px) {
    .lc-panel {
        width: calc(100vw - 30px);
        right: -5px;
        bottom: 65px;
        height: 320px;
        max-height: calc(100vh - 200px);
    }

    #live-chat-widget {
        bottom: 75px;
        right: 14px;
    }
}

/* Guest identity form (shown before a guest starts chatting) */
.lc-identity {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
}

.lc-identity__intro {
    margin: 0 0 2px;
    font-size: 13px;
    color: var(--lc-text, #334155);
}

.lc-identity .lc-input__field {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

.lc-identity .lc-input__field:focus {
    outline: none;
    border-color: var(--lc-primary, #1a56db);
}

.lc-identity__btn {
    padding: 10px 12px;
    background: var(--lc-primary, #1a56db);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.lc-identity__btn:hover {
    background: var(--lc-primary-hover, #1e40af);
}

.lc-identity__err {
    color: #dc2626;
    font-size: 12px;
}
