/* Live Chat Widget - Frontend Styles */
.lcwp-chat-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.lcwp-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.lcwp-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Toggle Button */
.lcwp-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.lcwp-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.lcwp-toggle-icon {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lcwp-unread-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* Chat Window */
.lcwp-chat-window {
    position: absolute;
    bottom: 80px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lcwp-position-bottom-right .lcwp-chat-window {
    right: 0;
}

.lcwp-position-bottom-left .lcwp-chat-window {
    left: 0;
}

/* Header */
.lcwp-chat-header {
    background: #2563eb;
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.lcwp-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.lcwp-chat-header-text {
    display: flex;
    flex-direction: column;
}

.lcwp-chat-title {
    font-weight: 600;
    font-size: 16px;
}

.lcwp-chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lcwp-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.lcwp-status-online {
    background: #22c55e;
}

.lcwp-status-offline {
    background: #9ca3af;
}

.lcwp-chat-minimize {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.lcwp-chat-minimize:hover {
    opacity: 1;
}

/* Messages Area */
.lcwp-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lcwp-chat-welcome {
    text-align: center;
    color: #6b7280;
    padding: 20px;
    font-size: 14px;
}

.lcwp-chat-welcome p {
    background: #e5e7eb;
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 4px;
    display: inline-block;
    margin: 0;
}

.lcwp-messages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lcwp-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.lcwp-message-visitor {
    background: #2563eb;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.lcwp-message-admin {
    background: #fff;
    color: #1f2937;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.lcwp-message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}

.lcwp-message-sender {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 2px;
    display: block;
}

/* Input Area */
.lcwp-chat-input-area {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.lcwp-chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.lcwp-message-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 100px;
    transition: border-color 0.2s;
}

.lcwp-message-input:focus {
    border-color: #2563eb;
}

.lcwp-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.lcwp-send-btn:hover {
    background: #1d4ed8;
}

/* Typing Indicator */
.lcwp-chat-typing {
    padding: 8px 16px;
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lcwp-typing-dots {
    display: flex;
    gap: 3px;
}

.lcwp-typing-dots span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: lcwp-typing-bounce 1.4s infinite ease-in-out;
}

.lcwp-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.lcwp-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes lcwp-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

/* Offline Form */
.lcwp-chat-offline-form {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.lcwp-chat-offline-form p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

.lcwp-offline-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 8px;
    resize: none;
    outline: none;
}

.lcwp-offline-input:focus {
    border-color: #2563eb;
}

.lcwp-offline-send-btn {
    width: 100%;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.lcwp-offline-send-btn:hover {
    background: #1d4ed8;
}

/* Footer */
.lcwp-chat-footer {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    background: #fff;
    border-top: 1px solid #f3f4f6;
}

/* Rating Section */
.lcwp-chat-rating {
    padding: 16px;
    text-align: center;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.lcwp-chat-rating p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

.lcwp-rating-stars {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.lcwp-rating-star {
    font-size: 28px;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    background: none;
    border: none;
    padding: 4px;
}

.lcwp-rating-star:hover,
.lcwp-rating-star.active {
    color: #f59e0b;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 480px) {
    .lcwp-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
    }

    .lcwp-position-bottom-right .lcwp-chat-window {
        right: -10px;
    }

    .lcwp-position-bottom-left .lcwp-chat-window {
        left: -10px;
    }
}

/* Scrollbar */
.lcwp-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.lcwp-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.lcwp-chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.lcwp-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}
