/* ===================================
   CHATBOT COMPONENT STYLES
   =================================== */

/* Chat Bubble Button */
.chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 
        0 4px 20px rgba(0, 217, 255, 0.4),
        0 0 40px rgba(0, 217, 255, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 2px solid rgba(0, 217, 255, 0.5);
    animation: pulse-bubble 3s ease-in-out infinite;
}

.chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 
        0 6px 30px rgba(0, 217, 255, 0.6),
        0 0 60px rgba(0, 217, 255, 0.3);
}

.chat-bubble i {
    font-size: 28px;
    color: var(--dark-bg);
}

.chat-bubble.open {
    background: rgba(10, 22, 40, 0.95);
    border-color: var(--primary-cyan);
}

.chat-bubble.open i {
    color: var(--primary-cyan);
}

@keyframes pulse-bubble {
    0%, 100% {
        box-shadow: 
            0 4px 20px rgba(0, 217, 255, 0.4),
            0 0 40px rgba(0, 217, 255, 0.2);
    }
    50% {
        box-shadow: 
            0 4px 30px rgba(0, 217, 255, 0.6),
            0 0 60px rgba(0, 217, 255, 0.4);
    }
}

/* Chat Container */
.chat-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: linear-gradient(135deg, rgba(10, 22, 40, 0.98) 0%, rgba(5, 13, 24, 0.98) 100%);
    border: 2px solid rgba(0, 217, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999;
    backdrop-filter: blur(10px);
}

.chat-container.open {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

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

/* Chat Header */
.chat-header {
    padding: 1.25rem 1.5rem;
    background: var(--gradient-primary);
    border-bottom: 2px solid rgba(0, 217, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.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: 20px;
}

.chat-title {
    display: flex;
    flex-direction: column;
}

.chat-title h3 {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark-bg);
    margin: 0;
    letter-spacing: 1px;
}

.chat-title span {
    font-size: 0.75rem;
    color: rgba(10, 22, 40, 0.7);
    font-weight: 500;
}

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

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

.chat-close i {
    font-size: 16px;
    color: var(--dark-bg);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 217, 255, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 217, 255, 0.5);
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 0.75rem;
    animation: messageSlide 0.3s ease-out;
}

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

.message.bot {
    align-items: flex-start;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: var(--gradient-primary);
    color: var(--dark-bg);
}

.message.user .message-avatar {
    background: rgba(0, 217, 255, 0.2);
    border: 1px solid var(--primary-cyan);
    color: var(--primary-cyan);
}

.message-bubble {
    max-width: 75%;
    padding: 0.875rem 1.125rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .message-bubble {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    color: var(--text-white);
    border-bottom-left-radius: 4px;
}

.message.user .message-bubble {
    background: var(--gradient-primary);
    color: var(--dark-bg);
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

.typing-indicator.active {
    display: flex;
}

.typing-indicator .message-avatar {
    background: var(--gradient-primary);
    color: var(--dark-bg);
}

.typing-dots {
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    padding: 0.875rem 1.125rem;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-cyan);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

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

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

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.welcome-message i {
    font-size: 3rem;
    color: var(--primary-cyan);
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

.welcome-message h4 {
    color: var(--text-white);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.welcome-message p {
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Chat Input */
.chat-input-container {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(0, 217, 255, 0.2);
}

.chat-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.chat-input {
    flex: 1;
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 24px;
    padding: 0.875rem 1.25rem;
    color: var(--text-white);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input:focus {
    background: rgba(0, 217, 255, 0.08);
    border-color: var(--primary-cyan);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.2);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
}

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

.chat-send-btn i {
    font-size: 18px;
    color: var(--dark-bg);
}

/* Error Message */
.error-message {
    background: rgba(255, 69, 69, 0.1);
    border: 1px solid rgba(255, 69, 69, 0.3);
    color: #ff6b6b;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    margin: 0.5rem 0;
    display: none;
}

.error-message.active {
    display: block;
    animation: messageSlide 0.3s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-container {
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        border-radius: 0;
        max-height: 100vh;
    }

    .chat-bubble {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .chat-bubble i {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .chat-container {
        height: 100%;
    }

    .chat-messages {
        padding: 1rem;
    }

    .message-bubble {
        max-width: 85%;
        font-size: 0.875rem;
    }
}
