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

/* Chat Button with Pulse Effect */
.chat-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8c00 0%, #ff6600 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 140, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    transition: all 0.3s ease;
    position: relative;
    animation: float 3s ease-in-out infinite;
}

.chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 140, 0, 0.6);
}

/* Pulse Effect */
.chat-widget-button::before,
.chat-widget-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 140, 0, 0.4);
    transform: translate(-50%, -50%);
    animation: pulse 2s ease-out infinite;
}

.chat-widget-button::after {
    animation-delay: 1s;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.8);
        opacity: 0;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Notification Badge */
.chat-widget-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.5);
    animation: bounce-badge 1s ease-in-out infinite;
}

@keyframes bounce-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Chat Window */
.chat-widget-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: var(--bg-primary, #ffffff);
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.chat-widget-window.open {
    display: flex;
}

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

/* Chat Header */
.chat-widget-header {
    background: linear-gradient(135deg, #ff8c00 0%, #ff6600 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

.chat-widget-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

.chat-widget-header-text p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.chat-widget-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-widget-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chat Messages */
.chat-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-secondary, #f8f5f1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.chat-widget-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

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

/* Message Bubbles */
.chat-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

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

.chat-message.bot {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8c00 0%, #ff6600 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chat-message.user .chat-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chat-message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: var(--text-dark, #333);
    font-size: 14px;
    line-height: 1.5;
}

.chat-message.user .chat-message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Typing Indicator */
.chat-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.chat-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff8c00;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

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

.chat-quick-reply {
    padding: 8px 16px;
    border-radius: 20px;
    background: white;
    border: 2px solid #ff8c00;
    color: #ff8c00;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.chat-quick-reply:hover {
    background: #ff8c00;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.3);
}

/* Chat Input */
.chat-widget-input {
    padding: 15px 20px;
    background: var(--bg-primary, #ffffff);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-widget-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    background: var(--bg-secondary, #f8f5f1);
    color: var(--text-dark, #333);
}

.chat-widget-input input:focus {
    border-color: #ff8c00;
    background: var(--bg-primary, #ffffff);
}

.chat-widget-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8c00 0%, #ff6600 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-widget-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.4);
}

.chat-widget-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Welcome Message */
.chat-welcome-message {
    text-align: center;
    padding: 20px;
    color: var(--text-light, #666);
}

.chat-welcome-message .welcome-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.chat-welcome-message h4 {
    margin: 0 0 10px 0;
    color: var(--text-dark, #333);
    font-size: 18px;
}

.chat-welcome-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 480px) {
    .chat-widget-container {
        bottom: 10px;
        right: 10px;
    }

    .chat-widget-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 70px;
        right: -10px;
    }

    .chat-widget-button {
        width: 55px;
        height: 55px;
        font-size: 24px;
    }
}

/* Dark Mode Support */
[data-theme="dark"] .chat-widget-window {
    background: #2a2a2a;
}

[data-theme="dark"] .chat-widget-messages {
    background: #353535;
}

[data-theme="dark"] .chat-message-bubble {
    background: #404040;
    color: #e8e6e3;
}

[data-theme="dark"] .chat-widget-input {
    background: #2a2a2a;
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .chat-widget-input input {
    background: #353535;
    border-color: #555;
    color: #e8e6e3;
}

[data-theme="dark"] .chat-widget-input input:focus {
    background: #404040;
}

[data-theme="dark"] .chat-quick-reply {
    background: #404040;
    border-color: #ff8c00;
}

[data-theme="dark"] .chat-welcome-message {
    color: #b0b0b0;
}

[data-theme="dark"] .chat-welcome-message h4 {
    color: #e8e6e3;
}
