/* Chat Widget Styles */

:root {
    --chat-primary: #e88ba0;
    --chat-accent: #ffd9e2;
    --chat-text: #333;
    --chat-bg: #fff;
    --chat-user-bg: #e88ba0;
    --chat-bot-bg: #f5f5f5;
    --chat-admin-bg: #4caf50;
}

/* Chat Button with Animations */
.chat-widget-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-primary) 0%, #d47a90 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(232, 139, 160, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s ease;
    animation: slideInBounce 1s ease-out 0.5s both;
}

@keyframes slideInBounce {
    0% {
        opacity: 0;
        transform: translateY(100px) scale(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-10px) scale(1.1);
    }
    70% {
        transform: translateY(5px) scale(0.95);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

.chat-widget-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 25px rgba(232, 139, 160, 0.6);
}

.chat-widget-button.active {
    background: #666;
    animation: none;
}

/* Pulse Animation for Chat Button */
.chat-widget-button::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--chat-primary);
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Notification Badge */
.chat-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: bold;
    border: 2px solid white;
    animation: bounce 0.5s ease infinite alternate;
}

@keyframes bounce {
    from {
        transform: translateY(0) scale(1);
    }
    to {
        transform: translateY(-5px) scale(1.1);
    }
}

/* Chat Welcome Bubble */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 999;
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-primary) 0%, #d47a90 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(232, 139, 160, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    animation: slideInBounce 1s ease-out 0.5s both;
}

.chat-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 25px rgba(232, 139, 160, 0.6);
}

.chat-button::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--chat-primary);
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

.chat-button svg {
    position: relative;
    z-index: 1;
}

.notification-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: bold;
    border: 2px solid white;
    z-index: 2;
    animation: bounce 0.5s ease infinite alternate;
}

.chat-bubble {
    position: absolute;
    bottom: 75px;
    right: 0;
    background: white;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    min-width: 250px;
    max-width: 300px;
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.chat-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
    animation: wiggle 0.5s ease 1.5s;
}

@keyframes wiggle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(-5deg); }
    75% { transform: translateY(-5px) rotate(5deg); }
}

.chat-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

.bubble-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.wave-emoji {
    font-size: 24px;
    animation: wave 0.6s ease infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-20deg); }
}

.bubble-content p {
    margin: 0;
    color: var(--chat-text);
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.bubble-close {
    position: absolute;
    top: 5px;
    right: 8px;
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.bubble-close:hover {
    color: var(--chat-primary);
}

/* Chat Container */
.chat-widget-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
}

.chat-widget-container.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--chat-primary) 0%, #d47a90 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chat-title-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-title-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

/* Chat Tabs */
.chat-tabs {
    display: flex;
    background: var(--chat-accent);
    border-bottom: 1px solid #e0e0e0;
}

.chat-tab {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    position: relative;
}

.chat-tab.active {
    color: var(--chat-primary);
    background: white;
}

.chat-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--chat-primary);
}

/* Welcome Screen */
.chat-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.chat-welcome-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.chat-welcome h3 {
    color: var(--chat-text);
    margin-bottom: 10px;
}

.chat-welcome p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.chat-welcome-form {
    width: 100%;
}

.chat-input-group {
    margin-bottom: 15px;
}

.chat-input-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.chat-input-group input:focus {
    outline: none;
    border-color: var(--chat-primary);
}

.chat-start-btn {
    width: 100%;
    padding: 14px;
    background: var(--chat-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-start-btn:hover {
    background: #d47a90;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    gap: 10px;
    max-width: 80%;
    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;
    flex-direction: row-reverse;
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-message.user .chat-message-avatar {
    background: var(--chat-user-bg);
    color: white;
}

.chat-message.bot .chat-message-avatar {
    background: var(--chat-bot-bg);
}

.chat-message.admin .chat-message-avatar {
    background: var(--chat-admin-bg);
    color: white;
}

.chat-message-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chat-message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message.user .chat-message-bubble {
    background: var(--chat-user-bg);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.bot .chat-message-bubble,
.chat-message.admin .chat-message-bubble {
    background: var(--chat-bot-bg);
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
}

.chat-message.admin .chat-message-bubble {
    background: #e8f5e9;
    border-left: 3px solid var(--chat-admin-bg);
}

.chat-message-time {
    font-size: 11px;
    color: #999;
    padding: 0 5px;
}

.chat-message.user .chat-message-time {
    text-align: right;
}

/* Chat Input */
.chat-input-container {
    border-top: 1px solid #e0e0e0;
    padding: 15px;
    background: white;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    font-family: 'Poppins', sans-serif;
}

.chat-input:focus {
    outline: none;
    border-color: var(--chat-primary);
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--chat-primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.chat-send-btn:hover {
    background: #d47a90;
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--chat-bot-bg);
    border-radius: 18px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-widget-container {
        width: calc(100% - 20px);
        height: calc(100% - 140px);
        bottom: 80px;
        right: 10px;
        left: 10px;
        border-radius: 15px;
    }
    
    .chat-widget-button {
        bottom: 20px;
        right: 20px;
    }
}
