/* General Styling for Chatbot Page */
.chatbot-page-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    background-color: #f0f2f5;
    min-height: 80vh;
}

.chat-wrapper {
    width: 100%;
    max-width: 800px;
    height: 70vh;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

/* Chat Header */
.chat-header {
    background: var(--bs-primary);
    color: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
}

.chat-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.chat-header p {
    opacity: 0.9;
}

/* Chat Area */
.chat-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-area::-webkit-scrollbar {
    width: 8px;
}

.chat-area::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-area::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.chat-area::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Messages */
.message {
    display: flex;
    align-items: flex-end;
    max-width: 75%;
}

.message p {
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

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

.user-message p {
    background: var(--bs-primary);
    color: #fff;
    border-bottom-right-radius: 5px;
}

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

.bot-message p {
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 5px;
}

.bot-message a {
    color: var(--bs-primary);
    text-decoration: underline;
}

/* Typing Indicator */
#typingIndicator p {
    padding: 0.75rem 1rem;
}
.typing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #888;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing-blink 1.4s infinite both;
}
.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes typing-blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}


/* Chat Input Area */
.chat-input-area {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.chat-input-area textarea {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
    margin-right: 0.75rem;
    transition: border-color 0.2s;
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.chat-input-area #sendButton {
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Feedback Buttons */
.feedback-container {
    margin-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 8px;
}

.feedback-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 15px;
    padding: 4px 10px;
    margin-right: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #555;
}

.feedback-btn:hover:not(:disabled) {
    background-color: #f0f0f0;
    border-color: #aaa;
}

.feedback-btn.selected {
    background-color: #d4edda; /* Green for like */
    border-color: #c3e6cb;
    color: #155724;
}

.feedback-btn.dislike.selected {
    background-color: #f8d7da; /* Red for dislike */
    border-color: #f5c6cb;
    color: #721c24;
}

.feedback-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbot-page-container {
        padding: 0;
        min-height: calc(100vh - 56px); /* Adjust for navbar height */
    }
    .chat-wrapper {
        height: calc(100vh - 56px); /* Adjust for navbar height */
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
    .chat-area {
        padding: 1rem;
    }
    .chat-input-area {
        padding: 0.5rem 1rem;
    }
    .message {
        max-width: 90%;
    }
}
.feedback-icon {
    cursor: pointer;
    font-size: 16px;
    margin-left: 8px;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

.feedback-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

.feedback-container.submitted .feedback-icon {
    cursor: default;
    opacity: 0.3;
}

.feedback-container.submitted .feedback-icon:hover {
    transform: none;
}

.feedback-container.submitted .feedback-icon.selected {
    opacity: 1;
    color: #007bff; /* Highlight selected feedback */
}

/* Styling for Download Links as Buttons */
.chat-download-btn {
    display: inline-block;
    background-color: var(--bs-primary);
    color: #fff !important; /* Use !important to override default link color */
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 10px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    border: 1px solid transparent;
}

.chat-download-btn:hover {
    background-color: #0056b3; /* A darker shade of the primary color */
    color: #fff !important;
    text-decoration: none;
    transform: translateY(-2px);
}
