/* Live Chat Widget Styles */

/* Chat Toggle Button (Floating) */
.chat-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #f57c00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245, 124, 0, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    color: #fff;
    font-size: 1.5rem;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(245, 124, 0, 0.5);
}

.chat-toggle-btn .chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f44336;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Chat Widget Container */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.chat-widget.active {
    display: flex;
}

.chat-widget.minimized {
    height: 60px;
}

.chat-widget.minimized .chat-widget-body {
    display: none;
}

/* Chat Header */
.chat-widget-header {
    background: #f57c00;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.chat-header-info i {
    font-size: 1.2rem;
}

.chat-header-actions {
    display: flex;
    gap: 10px;
}

.chat-minimize-btn,
.chat-close-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 1rem;
}

.chat-minimize-btn:hover,
.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Chat Body */
.chat-widget-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Welcome Message */
.chat-welcome {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.chat-welcome i {
    font-size: 3rem;
    color: #f57c00;
    margin-bottom: 15px;
    opacity: 0.5;
}

.chat-welcome p {
    margin: 0;
    font-size: 1rem;
}

/* Message Bubbles */
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.admin {
    align-self: flex-start;
}

.chat-message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
}

.chat-message.user .chat-message-bubble {
    background: #f57c00;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-message.admin .chat-message-bubble {
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-message-info {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 5px;
    padding: 0 5px;
}

.chat-message.user .chat-message-info {
    text-align: right;
}

.chat-message.admin .chat-message-info {
    text-align: left;
}

/* Chat Input Container */
.chat-input-container {
    display: flex;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    outline: none;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: #f57c00;
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    background: #f57c00;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 1.1rem;
}

.chat-send-btn:hover {
    background: #1565c0;
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    color: #6c757d;
    font-size: 0.9rem;
}

.chat-typing-dots {
    display: flex;
    gap: 4px;
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    background: #6c757d;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-10px);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-widget {
        width: calc(100% - 20px);
        height: calc(100vh - 100px);
        right: 10px;
        bottom: 10px;
        border-radius: 12px 12px 0 0;
    }

    .chat-toggle-btn {
        right: 20px;
        bottom: 20px;
    }
}

/* Loading State */
.chat-loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.chat-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
