/* Live Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Chat Toggle Button */
.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E40AF 0%, #0891B2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(30, 64, 175, 0.5);
}

.chat-toggle svg {
    color: white;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #EF4444;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #1E40AF 0%, #0891B2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.chat-status {
    margin: 4px 0 0;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.95;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-close svg {
    color: white;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #F8FAFC;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #64748B;
}

.chat-welcome p {
    margin: 8px 0;
    line-height: 1.6;
}

.chat-welcome p:first-child {
    font-size: 18px;
    font-weight: 600;
    color: #1E293B;
}

/* Chat Message */
.chat-message {
    display: flex;
    margin-bottom: 12px;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    justify-content: flex-end;
}

.admin-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
}

.user-message .message-content {
    background: linear-gradient(135deg, #1E40AF 0%, #0891B2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.admin-message .message-content {
    background: white;
    color: #1E293B;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    display: block;
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.7;
}

.user-message .message-time {
    text-align: right;
    color: rgba(255, 255, 255, 0.9);
}

.admin-message .message-time {
    color: #64748B;
}

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: white;
    border-top: 1px solid #E2E8F0;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E2E8F0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #1E40AF;
}

.chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E40AF 0%, #0891B2 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-send:hover {
    transform: scale(1.05);
}

.chat-send:active {
    transform: scale(0.95);
}

.chat-send svg {
    color: white;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-widget {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }

    .chat-window {
        width: 100%;
        right: 0;
        bottom: 80px;
        height: calc(100vh - 120px);
    }

    .chat-toggle {
        width: 56px;
        height: 56px;
    }
}
