.chat-history::-webkit-scrollbar { width: 8px; }
.chat-history::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.chat-history::-webkit-scrollbar-thumb { background: #888; border-radius: 10px; }
.chat-history::-webkit-scrollbar-thumb:hover { background: #555; }
.dark .chat-history::-webkit-scrollbar-track { background: #2d3748; }
.dark .chat-history::-webkit-scrollbar-thumb { background: #718096; }
.dark .chat-history::-webkit-scrollbar-thumb:hover { background: #a0aec0; }
body, .menu-bar, .chat-container, input, button, textarea, .modal-content, .auth-form {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* make sure the message entry bar is not hidden below the bottom of the screen on Android:
 * */
@media (max-width: 767px) { /* This targets screens up to 767px wide */
    body {
        padding-bottom: 50px !important; 
        box-sizing: border-box !important;
    }
}


.message-bubble { padding: 10px 15px; border-radius: 15px; margin-bottom: 10px; max-width: 75%; word-wrap: break-word; line-height: 1.6; position: relative; }
.user-message { background-color: #DCF8C6; align-self: flex-end; border-bottom-right-radius: 5px; }
.dark .user-message { background-color: #225C44; color: #E2E8F0; }
.agent-message { background-color: #E5E7EB; align-self: flex-start; border-bottom-left-radius: 5px; }
.dark .agent-message { background-color: #4A5568; color: #E2E8F0; }
.system-ui-message { background-color: #f0f4f8; color: #4a5568; align-self: flex-start; border-bottom-left-radius: 5px;} 
.dark .system-ui-message { background-color: #2c3e50; color: #bdc3c7; }

.message-sender { font-size: 0.75rem; color: #6B7280; margin-bottom: 4px; font-weight: bold; }
.dark .message-sender { color: #A0AEC0; }
.loader { border: 4px solid #f3f3f3; border-top: 4px solid #3498db; border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; margin-left: 10px; }
.dark .loader { border-top: 4px solid #60a5fa; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.modal-backdrop { background-color: rgba(0,0,0,0.5); }
.prompt-item { cursor: pointer; }
.dark .prompt-item { color: #D1D5DB; }
.prompt-item.selected { background-color: #E0E7FF; color: #4338CA; }
.dark .prompt-item.selected { background-color: #3730A3; color: #E0E7FF; }
.hidden { display: none !important; } 
.fa-spinner { animation: spin 1s linear infinite; }

#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050; 
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 15px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    opacity: 0; 
    transform: translateX(100%);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}
.toast.show {
    opacity: 0.95;
    transform: translateX(0);
}
.toast.info { background-color: #3498db; }
.toast.success { background-color: #2ecc71; }
.toast.error { background-color: #e74c3c; }

.message-content ul {
    list-style-type: disc; 
    padding-left: 25px; 
    margin-top: 0.5em; 
    margin-bottom: 0.5em;
}
.message-content li {
    margin-bottom: 0.25em; 
    line-height: 1.5;
}
 .message-content p {
    margin-top: 0; 
    margin-bottom: 1em; 
}
 .message-content p:last-child {
    margin-bottom: 0;
}
.message-content pre {
    white-space: pre-wrap; 
    word-wrap: break-word; 
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}
.menu-item span {
    width: 100%;
    text-align: center;
}
#settingsModal .modal-content-body, 
#feedbackDisplayModal .modal-content-body,
#adviceDisplayModal .modal-content-body,
#newUserWizardModal .modal-content-body { 
     max-height: calc(80vh - 120px); 
     overflow-y: auto;
}
.feedback-grade-circle {
    width: 8rem; 
    height: 8rem; 
    border-radius: 9999px; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem; 
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); 
}
.feedback-grade-text {
    font-size: 3rem; 
    font-weight: 700; 
}
#cookieConsentBanner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(31, 41, 55, 0.95); 
    color: white;
    padding: 1rem; 
    z-index: 1000; 
    display: flex; 
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}
.dark #cookieConsentBanner {
     background-color: rgba(17, 24, 39, 0.95); 
}
#cookieConsentBanner p {
    margin-bottom: 0.75rem; 
    font-size: 0.875rem; 
}
#cookieConsentBanner button {
    background-color: #6d28d9; 
    color: white;
    padding: 0.5rem 1rem; 
    border-radius: 0.375rem; 
    font-weight: 600; 
    transition: background-color 0.2s ease;
}
#cookieConsentBanner button:hover {
    background-color: #5b21b6; 
}
.wizard-step-content {
    padding-bottom: 1rem; 
}
.wizard-step-content label {
    display: block;
    margin-bottom: 0.25rem; /* mb-1 */
    font-weight: 500; /* medium */
}
.wizard-step-content select {
    width: 100%;
    padding: 0.5rem; /* p-2 */
    border-width: 1px;
    border-radius: 0.375rem; /* rounded-md */
    background-color: white; /* bg-white */
}
.dark .wizard-step-content select {
    background-color: #4A5568; /* dark:bg-gray-700 */
    border-color: #718096; /* dark:border-gray-600 */
}

/* In your style.css or within <style> tags in practice.html */
.event-bubble {
    background-color: #e0e7ff; /* Light indigo background */
    border-left: 4px solid #6366f1; /* Indigo border */
    padding: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem; /* text-sm */
    position: relative; /* Needed for positioning delete button */
}

.dark .event-bubble {
    background-color: #3730a3; /* Darker indigo for dark mode */
    border-left-color: #818cf8; /* Lighter indigo border for dark mode */
    color: #e0e7ff; /* Light text for dark mode */
}

.event-bubble .event-header {
    font-style: italic;
    color: #4f46e5; /* Indigo text */
    margin-bottom: 0.25rem;
}

.dark .event-bubble .event-header {
    color: #a5b4fc; /* Lighter indigo text for dark mode */
}

.event-bubble .event-content-display {
    color: #374151; /* Dark gray text */
}
.dark .event-bubble .event-content-display {
    color: #d1d5db; /* Light gray text for dark mode */
}

.message-bubble {
    max-width: 85%;
}

/* *** MODIFIED STYLE for event delete button *** */
.event-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af; /* gray-400 */
    padding: 0.25rem;
    line-height: 1;
    border-radius: 9999px;
    opacity: 0.5;
    transition: opacity 0.2s, background-color 0.2s;
    display: inline-flex;
}
.dark .event-delete-btn {
    color: #a5b4fc; /* Corrected: Lighter indigo text for dark mode */
}

/* Message Action Menu Styles */
.message-actions-trigger {
    position: absolute;
    top: -5px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    padding: 0;
    cursor: pointer;
    display: none; /* Hidden by default */
    color: #6b7280;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.dark .message-actions-trigger {
    background: #4b5563;
    border-color: #6b7280;
    color: #d1d5db;
}

.message-bubble:hover .message-actions-trigger {
    display: inline-flex; /* Show on hover */
    align-items: center;
    justify-content: center;
}

.user-message .message-actions-trigger {
    left: -10px;
    right: auto;
}

.agent-message .message-actions-trigger, .system-event-bubble .message-actions-trigger, .system-ui-message .message-actions-trigger {
    right: -10px;
}

.message-actions-menu {
    position: absolute;
    top: 25px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 20;
    min-width: 220px;
    display: none; /* Toggled by JS */
    padding: 4px 0;
}

.dark .message-actions-menu {
    background-color: #374151; /* gray-700 */
    border-color: #4b5563; /* gray-600 */
}

.message-actions-menu.show {
    display: block;
}

.agent-message .message-actions-menu { right: 0; }
.user-message .message-actions-menu { left: 0; }

.message-actions-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    font-size: 14px;
    color: #1f2937;
    background: none;
    border: none;
    cursor: pointer;
}

.dark .message-actions-menu-item {
    color: #f3f4f6;
}

.message-actions-menu-item:hover {
    background-color: #f3f4f6;
}

.dark .message-actions-menu-item:hover {
    background-color: #4b5563;
}

.message-actions-menu-item i.fas {
    margin-right: 10px;
    width: 16px;
    text-align: center;
    color: #6b7280;
}

.dark .message-actions-menu-item i.fas {
    color: #9ca3af;
}

/* Status indicator for pending/failed messages */
.message-status-indicator {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 5px;
    text-align: right;
}

.dark .message-status-indicator {
    color: #9ca3af;
}

.message-status-indicator .resend-btn {
    background: none;
    border: none;
    color: #3b82f6; /* blue-500 */
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin-left: 5px;
    font-size: 0.8rem;
}

.dark .message-status-indicator .resend-btn {
    color: #60a5fa; /* blue-400 */
}

/* MODIFICATION START: Glowing button effect for video send */
@keyframes glowing {
    0% { box-shadow: 0 0 5px #2563eb, 0 0 10px #2563eb, 0 0 15px #2563eb; }
    50% { box-shadow: 0 0 20px #3b82f6, 0 0 30px #3b82f6, 0 0 40px #3b82f6; }
    100% { box-shadow: 0 0 5px #2563eb, 0 0 10px #2563eb, 0 0 15px #2563eb; }
}

.glowing-button {
    animation: glowing 1.5s infinite ease-in-out;
}
/* MODIFICATION END */


