/* Live Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Poppins', sans-serif;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #2c5aa0, #1e3a8a);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(44, 90, 160, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(44, 90, 160, 0.4);
}

.chat-toggle i {
    color: white;
    font-size: 24px;
    transition: all 0.3s ease;
}

.chat-toggle.active i.fa-comments {
    transform: rotate(180deg);
    opacity: 0;
}

.chat-toggle.active i.fa-times {
    transform: rotate(0deg);
    opacity: 1;
}

.chat-toggle i.fa-times {
    position: absolute;
    transform: rotate(-180deg);
    opacity: 0;
}

/* Notification Badge */
.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(20px) scale(0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    border: 1px solid #e1e8ed;
}

.chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #2c5aa0, #1e3a8a);
    color: white;
    padding: 20px;
    border-radius: 15px 15px 0 0;
    position: relative;
}

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

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

.chat-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

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

.status-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Chat Body */
.chat-body {
    height: 350px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Messages */
.message {
    margin-bottom: 15px;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.message.bot {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.message.user {
    display: flex;
    justify-content: flex-end;
}

.message-avatar {
    width: 30px;
    height: 30px;
    background: #2c5aa0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    flex-shrink: 0;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
}

.message.bot .message-content {
    background: white;
    border: 1px solid #e1e8ed;
    border-bottom-left-radius: 6px;
}

.message.user .message-content {
    background: #2c5aa0;
    color: white;
    border-bottom-right-radius: 6px;
}

.message-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 5px;
    text-align: right;
}

.message.bot .message-time {
    text-align: left;
}

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-reply {
    background: white;
    border: 1px solid #2c5aa0;
    color: #2c5aa0;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-reply:hover {
    background: #2c5aa0;
    color: white;
}

/* Chat Input */
.chat-input {
    padding: 15px 20px;
    border-top: 1px solid #e1e8ed;
    background: white;
    border-radius: 0 0 15px 15px;
}

.input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input input {
    flex: 1;
    border: 1px solid #e1e8ed;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.chat-input input:focus {
    border-color: #2c5aa0;
}

.send-button {
    width: 40px;
    height: 40px;
    background: #2c5aa0;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-button:hover {
    background: #1e3a8a;
    transform: scale(1.05);
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

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

.typing-dot {
    width: 8px;
    height: 8px;
    background: #2c5aa0;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-widget {
        bottom: 15px;
        right: 15px;
    }
    
    .chat-window {
        width: 300px;
        height: 450px;
        bottom: 75px;
    }
    
    .chat-body {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 30px);
        right: -15px;
        height: 400px;
    }
    
    .chat-body {
        height: 250px;
    }
}
