/* AI Chat Widget Styles */

.chat-container {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
    pointer-events: none;
}

/* Messages Area */
.chat-messages {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 20px 20px 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: auto;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

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

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

/* Individual Message */
.message {
    display: flex;
    padding: 12px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    color: white;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 15px;
    animation: messageSlideIn 0.3s ease-out;
}

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

/* User Messages (right side, white border) */
.message.user {
    align-self: flex-end;
    border: 1px solid white;
    text-align: right;
}

/* Agent Messages (left side, neon blue border) */
.message.agent {
    align-self: flex-start;
    background: rgba(0, 153, 255, 0.25);
    border: 1px solid rgba(0, 153, 255, 0.9);
    text-align: left;
}

/* Typing Indicator */
.message.typing {
    align-self: flex-start;
    border: 1px solid rgba(0, 153, 255, 0.9);
    padding: 12px 20px;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

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

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Chat Input Bar */
.chat-input-container {
    padding: 15px 20px;
    background: transparent;
    backdrop-filter: none;
    border: none;
    border-radius: 12px;
    margin: 0 10px;
    pointer-events: auto;
}

.chat-input-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.chat-input:focus {
    border-color: white;
    background: rgba(255, 255, 255, 0.3);
}

.chat-send-btn {
    padding: 12px 24px;
    background: rgba(34, 197, 94, 0.3);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgb(74, 222, 128);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chat-send-btn:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.5);
    transform: translateY(-1px);
}

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

/* System Messages */
.message.system {
    align-self: center;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-style: italic;
    max-width: 90%;
    text-align: center;
}

/* Loading State */
.chat-loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.7);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-container {
        max-width: 100%;
    }
    
    .chat-messages {
        max-height: calc(100vh - 180px);
        padding: 15px 10px;
    }
    
    .message {
        max-width: 85%;
        font-size: 14px;
        padding: 10px 14px;
    }
    
    .chat-input-container {
        margin: 0;
        border-radius: 0;
        padding: 12px 10px;
    }
    
    .chat-input {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .chat-send-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Hide chat on very small screens */
@media (max-width: 480px) {
    .chat-messages {
        max-height: calc(100vh - 160px);
    }
}

/* Empty state */
.chat-empty {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.chat-empty p {
    margin: 0;
    font-size: 16px;
}
