/* Chat Widget Styles */
#chat-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    font-family: 'DM Sans', sans-serif;
}

/* Chat Toggle Button - Robot Emoji */
#chat-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(14, 165, 233, 0.4),
                0 2px 8px rgba(14, 165, 233, 0.2);
    transition: all 0.3s ease;
}

#chat-toggle:hover {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.5),
                0 4px 12px rgba(14, 165, 233, 0.3);
}

#chat-toggle:active {
    transform: scale(0.98) translateY(0);
}

.robot-emoji {
    font-size: 2.4rem;
    line-height: 1;
    user-select: none;
    animation: float 3s ease-in-out infinite;
}

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

/* Chat Container */
#chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: rgba(20, 20, 22, 0.98);
    border: 1px solid rgba(14, 165, 233, 0.3);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#chat-container.chat-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
#chat-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(56, 189, 248, 0.1) 100%);
    border-bottom: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#chat-header span {
    font-weight: 600;
    font-size: 1rem;
    color: #e0e0e0;
}

#chat-close {
    background: none;
    border: none;
    color: #b0b0b0;
    font-size: 1.75rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    line-height: 1;
}

#chat-close:hover {
    color: #e0e0e0;
}

/* Chat Messages */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

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

#chat-messages::-webkit-scrollbar-track {
    background: rgba(14, 165, 233, 0.05);
}

#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(77, 199, 255, 0.3);
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(14, 165, 233, 0.5);
}

/* Message Bubbles */
.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: slideIn 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
}

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

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.message.user .message-content {
    background: linear-gradient(135deg, #60a5faa1 0%, #38bdf8 100%);
    color: white;
    border-radius: 12px 12px 2px 12px;
}

.message.bot .message-content {
    background: rgba(14, 164, 233, 0.185);
    color: #e0e0e0;
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 12px 12px 12px 2px;
}

.message-time {
    font-size: 0.7rem;
    color: #808080;
    margin-top: 0.25rem;
    padding: 0 0.5rem;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 12px 12px 12px 2px;
    width: fit-content;
}

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

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

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

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

/* Chat Input */
#chat-input-container {
    padding: 1rem;
    border-top: 1px solid rgba(14, 165, 233, 0.2);
    display: flex;
    gap: 0.5rem;
}

#chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(14, 165, 233, 0.05);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.9rem;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s ease;
}

#chat-input:focus {
    outline: none;
    background: rgba(14, 165, 233, 0.1);
    border-color: #0ea5e9;
}

#chat-input::placeholder {
    color: #808080;
}

#chat-send {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'DM Sans', sans-serif;
}

#chat-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.4);
}

#chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #chat-widget {
        bottom: 1rem;
        right: 1rem;
    }

    #chat-container {
        width: calc(100vw - 2rem);
        max-width: 380px;
        height: 500px;
        bottom: 75px;
    }

    #chat-toggle {
        width: 55px;
        height: 55px;
    }
}
