/* FAQ Chatbot Styles */

/* Message Styles */
.message {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    animation: fadeInUp 0.3s ease-out;
}

.message-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    position: relative;
}

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

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

.message-content {
    max-width: 85%;
    padding: 0.875rem 1.125rem;
    border-radius: 1.125rem;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: pre-wrap;
}

.user-message .message-wrapper {
    justify-content: flex-end;
    margin-left: auto;
}

.assistant-message .message-wrapper {
    justify-content: flex-start;
    margin-right: auto;
}

.user-message .message-content {
    background: linear-gradient(135deg, #000000 0%, #374151 100%);
    color: white;
    border-bottom-right-radius: 0.375rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.assistant-message .message-content {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #374151;
    border-bottom-left-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-timestamp {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
    opacity: 0.8;
}

.user-message .message-timestamp {
    text-align: right;
    margin-right: 0.5rem;
}

.assistant-message .message-timestamp {
    text-align: left;
    margin-left: 0.5rem;
}

/* Typing Indicator */
.typing .message-content {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    max-width: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.typing-dots {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.typing-dots span {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background-color: #6b7280;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    30% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Chat Input Focus States */
#chat-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#chat-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#chat-send-btn:active {
    transform: translateY(0);
}

/* Scrollbar Styling */
#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status Indicator Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Reset Button Styles */
.reset-btn {
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.reset-btn:hover {
    border-color: #fecaca;
}

/* Reset Notification Styles */
.reset-notification {
    margin: 1rem 0;
    animation: fadeInUp 0.3s ease-out;
}

/* Copy Button Styles */
.copy-btn {
    background: none;
    border: none;
    padding: 0.375rem;
    border-radius: 0.375rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0;
    transform: translateY(0.25rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background-color: rgba(107, 114, 128, 0.1);
    color: #374151;
    transform: translateY(0);
}

.copy-btn:active {
    transform: scale(0.95);
}

.message-wrapper:hover .copy-btn {
    opacity: 1;
    transform: translateY(0);
}

.user-message .copy-btn {
    color: rgba(255, 255, 255, 0.7);
}

.user-message .copy-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.copy-icon {
    transition: all 0.2s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Chat Header Mobile */
    .reset-btn span {
        display: none; /* Hide "Reset" text on mobile */
    }
    
    .reset-btn {
        padding: 0.5rem;
        min-width: auto;
    }
    
    /* Chat Messages Mobile */
    .message-content {
        max-width: 85%;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: pre-wrap;
    }
    
    .copy-btn {
        opacity: 1; /* Always visible on mobile */
        transform: translateY(0);
        padding: 0.25rem;
    }
    
    /* Chat Input Mobile */
    #chat-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.875rem 1rem;
    }
    
    #chat-send-btn {
        padding: 0.875rem 1rem;
        min-width: auto;
    }
    
    #chat-send-btn span {
        display: none; /* Hide "Send" text on mobile */
    }
    
    /* Chat Messages Container Mobile */
    #chat-messages {
        min-height: 250px;
        max-height: 350px;
        padding: 1rem;
    }
    
    /* Reset Notification Mobile */
    .reset-notification {
        margin: 0.75rem 0;
    }
    
    .reset-notification div {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .message-content {
        max-width: 90%;
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: pre-wrap;
    }
    
    .message-timestamp {
        font-size: 0.6875rem;
        margin-top: 0.125rem;
    }
    
    #chat-messages {
        min-height: 200px;
        max-height: 300px;
        padding: 0.75rem;
    }
    
    #chat-input {
        padding: 0.75rem 0.875rem;
    }
    
    #chat-send-btn {
        padding: 0.75rem 0.875rem;
    }
}