/* ============================================
   Filament Comments - WhatsApp Style Chat
   ============================================ */

/* Chat window container */
.fc-chat-window {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Messages container with scroll */
.fc-chat-messages-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 55vh;
    overflow-y: auto;
    padding: 1rem 0;
    scroll-behavior: smooth;
}

/* Custom scrollbar */
.fc-chat-messages-container::-webkit-scrollbar {
    width: 6px;
}

.fc-chat-messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.fc-chat-messages-container::-webkit-scrollbar-thumb {
    background-color: rgb(156 163 175 / 0.4);
    border-radius: 3px;
}

.dark .fc-chat-messages-container::-webkit-scrollbar-thumb {
    background-color: rgb(75 85 99 / 0.5);
}

/* ============================================
   Chat Bubble (using Filament Section)
   ============================================ */

.fc-chat-bubble {
    max-width: 85%;
    transition: all 0.2s ease;
}

.fc-chat-bubble-left {
    margin-right: auto !important;
    margin-left: 0 !important;
}

.fc-chat-bubble-right {
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* Override Filament Section styles for chat bubbles */
.fc-chat-bubble .fi-section {
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.1), 0 1px 2px rgb(0 0 0 / 0.06);
}

/* Left bubble (Admin) - uses Filament secondary style with border */
.fc-chat-bubble-left .fi-section {
    border: 1px solid rgb(229 231 235); /* gray-200 */
}

.dark .fc-chat-bubble-left .fi-section {
    border-color: rgb(75 85 99); /* gray-600 */
}

/* Right bubble (Client) - Green WhatsApp style */
.fc-chat-bubble-right .fi-section {
    background-color: #dcf8c6 !important; /* WhatsApp green */
    border: 1px solid rgb(190 227 167) !important; /* green border */
}

.dark .fc-chat-bubble-right .fi-section {
    background-color: rgb(6 78 59 / 0.5) !important; /* emerald-950/50 */
    border-color: rgb(6 95 70 / 0.6) !important; /* emerald-800/60 */
}

/* ============================================
   Bubble Header
   ============================================ */

.fc-chat-bubble-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.fc-chat-bubble-author {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgb(79 70 229); /* indigo-600 */
}

.fc-chat-bubble-right .fc-chat-bubble-author {
    color: rgb(21 128 61); /* green-700 */
}

.dark .fc-chat-bubble-author {
    color: rgb(165 180 252); /* indigo-300 */
}

.dark .fc-chat-bubble-right .fc-chat-bubble-author {
    color: rgb(134 239 172); /* green-300 */
}

.fc-chat-bubble-date {
    font-size: 0.625rem;
    color: rgb(156 163 175); /* gray-400 */
    font-weight: 500;
}

.dark .fc-chat-bubble-date {
    color: rgb(156 163 175); /* gray-400 */
}

/* Fix section heading weight */
.fc-chat-bubble .fi-section-header-heading {
    font-weight: 500 !important;
}

/* ============================================
   Bubble Content
   ============================================ */

.fc-chat-bubble-content {
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgb(31 41 55); /* gray-800 */
    word-wrap: break-word;
}

.fc-chat-bubble-content p {
    margin: 0;
}

.fc-chat-bubble-content p + p {
    margin-top: 0.5rem;
}

.fc-chat-bubble-content ul,
.fc-chat-bubble-content ol {
    margin: 0.25rem 0;
    padding-left: 1.25rem;
}

.fc-chat-bubble-content a {
    color: rgb(37 99 235); /* blue-600 */
    text-decoration: underline;
}

.dark .fc-chat-bubble-content {
    color: rgb(243 244 246); /* gray-100 */
}

.dark .fc-chat-bubble-content a {
    color: rgb(96 165 250); /* blue-400 */
}

/* Right bubble content colors */
.fc-chat-bubble-right .fc-chat-bubble-content {
    color: rgb(31 41 55); /* gray-800 */
}

.dark .fc-chat-bubble-right .fc-chat-bubble-content {
    color: rgb(209 250 229); /* emerald-100 */
}

/* ============================================
   Empty State
   ============================================ */

.fc-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: rgb(107 114 128); /* gray-500 */
    text-align: center;
}

.dark .fc-chat-empty {
    color: rgb(156 163 175); /* gray-400 */
}

.fc-chat-empty-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.fc-chat-empty p {
    font-size: 0.875rem;
}

/* ============================================
   Message Form
   ============================================ */

.fc-chat-form {
    margin-top: 1rem;
}

.fc-chat-form-container {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.fc-chat-form-editor {
    flex: 1;
}

/* Rich editor styling adjustments */
.fc-chat-form-editor .fi-fo-rich-editor {
    border-radius: 0.75rem;
    overflow: hidden;
}

.fc-chat-form-editor .fi-fo-rich-editor-content {
    min-height: 2.5rem;
}

/* ============================================
   Login Message
   ============================================ */

.fc-chat-login-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    margin-top: 1rem;
    background-color: rgb(243 244 246); /* gray-100 */
    border-radius: 0.75rem;
    text-align: center;
    color: rgb(75 85 99); /* gray-600 */
}

.dark .fc-chat-login-message {
    background-color: rgb(31 41 55); /* gray-800 */
    color: rgb(156 163 175); /* gray-400 */
}

.fc-chat-login-message-icon {
    width: 1.5rem;
    height: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.fc-chat-login-message p {
    font-size: 0.875rem;
    margin: 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 640px) {
    .fc-chat-bubble {
        max-width: 95%;
    }

    .fc-chat-bubble-content {
        font-size: 0.8125rem;
    }
}

/* ============================================
   Fix for Filament tabs active state
   ============================================ */

.fi-sc-tabs.fi-vertical .fi-sc-tabs-tab.fi-active {
    margin-inline-start: 0 !important;
}
