/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

/* Greeting Bubble */
.chat-greeting {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 280px;
    padding: 16px 20px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 4px 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.chat-greeting.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

@keyframes greetingSlideIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-greeting::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 8px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #1a1a1a;
}

.greeting-text {
    color: #f9fafb;
    font-size: 0.95rem;
    line-height: 1.5;
    padding-right: 20px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.greeting-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.greeting-close:hover {
    background: rgba(220, 20, 60, 0.2);
    color: #93061d;
}

.chat-greeting.hidden {
    display: none;
}

/* Chatbot Button */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #93061d 0%, #93061d 100%);
    border: none;
    box-shadow: 
        0 8px 24px rgba(220, 20, 60, 0.4),
        0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 
            0 8px 24px rgba(220, 20, 60, 0.4),
            0 4px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 
            0 8px 32px rgba(220, 20, 60, 0.6),
            0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 
        0 12px 32px rgba(220, 20, 60, 0.5),
        0 6px 12px rgba(0, 0, 0, 0.3);
}

.chatbot-icon {
    width: 28px;
    height: 28px;
    color: white;
}

.chatbot-notification {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: #93061d;
    color: white;
    border-radius: 50%;
    border: 3px solid white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: notificationPop 0.4s ease;
}

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

.chatbot-notification.hidden {
    display: none;
}

/* Chatbot Panel */
.chatbot-panel {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 140px);
    background: #111111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: right calc(100% + 40px);
    transform: scale(0.3) translateY(80px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.4s ease;
}

.chatbot-panel.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, #93061d 0%, #93061d 100%);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
}

.chatbot-header-info h3 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.chatbot-status {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chatbot-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    display: inline-block;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

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

/* Messages Area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

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

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(220, 20, 60, 0.3);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(220, 20, 60, 0.5);
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    animation: messageSlideIn 0.3s ease;
}

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

.message.bot {
    flex-direction: row;
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #93061d 0%, #93061d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #1a1a1a;
}

.message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.message.bot .message-bubble {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f9fafb;
    border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
    background: var(--accent);
    border: none;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #93061d;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

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

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

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

/* Quick Replies */
.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px 0;
    background: #0a0a0a;
}

.quick-reply {
    padding: 8px 16px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.quick-reply:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
}

/* Input Area */
.chatbot-input-area {
    background: #111111;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-input-wrapper {
    display: flex;
    gap: 8px;
    padding: 16px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    font-size: 0.95rem;
    color: #f9fafb;
    outline: none;
    transition: all 0.3s ease;
}

.chatbot-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chatbot-input:focus {
    border-color: var(--accent);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border: none;
    background: #93061d;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-send:hover {
    background: #93061d;
    transform: scale(1.1);
}

.chatbot-send svg {
    width: 20px;
    height: 20px;
}

/* Service Cards in Chat */
.service-card {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.service-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.service-card h4 {
    color: #93061d;
    margin: 0 0 8px 0;
    font-size: 1rem;
}

.service-card p {
    color: #f9fafb;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Background Overlay Effect */
body.chatbot-active {
    overflow: hidden;
}

body.chatbot-active::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 9998;
    transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

body.chatbot-active.blur-active::before {
    background: rgba(0, 0, 0, 0.7);
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 480px) {
    .chatbot-panel {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 100px;
        max-height: calc(100vh - 140px);
        border-radius: 20px;
        transform-origin: calc(100% - 10px) calc(100% + 40px);
    }
    
    .chat-greeting {
        width: 240px;
        right: 10px;
        bottom: 80px;
    }
    
    .chatbot-container {
        right: 20px;
        bottom: 20px;
    }
}
