/* Modern Chat Container */
.jazital-chat-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin: 25px 0;
    border: 1px solid #e8e8e8;
    transition: box-shadow 0.2s ease;
}

.jazital-chat-container:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.jazital-chat-header {
    background: #2563eb;
    padding: 18px 20px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
}

.jazital-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.jazital-chat-header:hover::before {
    left: 100%;
}

.jazital-chat-header:hover {
    background: #1d4ed8;
}

.jazital-chat-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jazital-chat-header-heading {
    color: #ffffff;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.jazital-chat-header-arrow {
    color: #ffffff;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.jazital-chat-header-arrow.rotated {
    transform: rotate(180deg);
}

.jazital-chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.jazital-chat-typing-indicator {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.jazital-chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: #fff;
}

.jazital-chat-message {
    margin-bottom: 15px;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.jazital-chat-message.sent {
    background: #e3f2fd;
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.jazital-chat-message.received {
    background: #f1f1f1;
    margin-right: auto;
    border-bottom-left-radius: 0;
}

.jazital-chat-message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.jazital-chat-input {
    display: flex;
    padding: 10px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
}

.jazital-chat-input textarea {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    min-height: 50px;
    margin-right: 10px;
}

.jazital-chat-input button {
    padding: 10px 20px;
}

.jazital-chat-no-messages {
    text-align: center;
    color: #999;
    padding: 20px;
}

#jazital-chat-initiate {
    display: block;
    margin: 20px 0;
    padding: 5px 20px;
}

.jazital-chat-list {
    margin-bottom: 30px;
}

.jazital-chat-list h3 {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.jazital-chat-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.jazital-chat-list li {
    border-bottom: 1px solid #eee;
    padding: 15px 0;
}

.jazital-chat-list li a {
    display: block;
    color: #333;
    text-decoration: none;
}

.jazital-chat-list .last-message {
    display: block;
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.jazital-chat-list .last-time {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 3px;
}




/* Add these new styles */
.jazital-chat-account-container {
    max-width: 800px;
    margin: 0 auto;
}

.jazital-chat-search {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.jazital-chat-search input {
    flex: 1;
    padding: 10px;
}

.chat-list-item {
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-list-item:hover {
    background-color: #f9f9f9;
}

.chat-product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.chat-product-info h4 {
    margin: 0;
    font-size: 16px;
}

.vendor-name {
    color: #666;
    font-size: 14px;
}

.last-message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    background-color: #f5f5f5;
}

.last-message.sent {
    background-color: #e3f2fd;
}

.message-time {
    font-size: 12px;
    color: #999;
    display: block;
    margin-top: 5px;
}

.view-chat {
    display: inline-block;
    margin-top: 10px;
}





.jazital-chat-initiate-container {
    margin: 20px 0;
}

.jazital-chat-initiate-container textarea {
    width: 100%;
    min-height: 100px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.jazital-chat-search form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.jazital-chat-search input {
    flex: 1;
    padding: 10px;
}

.chat-list-item {
    border: 1px solid #eee;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.chat-product-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.view-chat {
    display: inline-block;
    margin-top: 10px;
}



/* Wrapper animation base styles */
.jazital-chat-wrapper {
    overflow: hidden;
    display: none; /* Start hidden - jQuery will handle showing */
}


/* Optional: Add easing to the slide animation */
.ui-effects-wrapper {
    transition-timing-function: ease-in-out;
}


.jazital-chat-header-arrow {
    width: 12px;
    height: 12px;
    transition: transform 0.3s ease;
    display: inline-block; 
     transform-origin: 50% 50%; 
}

.jazital-chat-header-arrow.rotated {
    transform: rotate(180deg);
}

/* Blocked User Notice */
.jazital-chat-blocked-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ff9800;
    color: #856404;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.jazital-chat-blocked-notice p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
}

.jazital-chat-initiate-container .button:active {
    transform: translateY(0);
}

/* Chat Wrapper */
.jazital-chat-wrapper.d-none {
    display: none;
}

.jazital-chat-wrapper {
    padding: 16px 20px 20px;
    background: #fafafa;
}

/* Messages Container */
.jazital-chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid #e8e8e8;
    scroll-behavior: smooth;
}

.jazital-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.jazital-chat-messages::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 10px;
}

.jazital-chat-messages::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 10px;
}

.jazital-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.jazital-chat-no-messages {
    text-align: center;
    color: #9ca3af;
    padding: 50px 20px;
    font-size: 14px;
}

/* Message Bubbles */
.jazital-chat-message {
    margin-bottom: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 75%;
 /* Modern Chat Container */
.jazital-chat-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin: 25px 0;
    border: 1px solid #e8e8e8;
    transition: box-shadow 0.2s ease;
}

.jazital-chat-container:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Clickable Header for Product Page Accordion */
.jazital-chat-header {
    background: #2563eb;
    padding: 14px 18px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease;
}

.jazital-chat-header:hover {
    background: #1d4ed8;
}

.jazital-chat-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.jazital-chat-header-heading {
    color: #ffffff;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.jazital-chat-header-arrow {
    color: #ffffff;
    font-size: 13px;
    transition: transform 0.2s ease;
}

.jazital-chat-header-arrow.rotated {
    transform: rotate(180deg);
}

/* Static Header for Conversation View (My Account) */
.jazital-chat-header-static {
    background: #f8f9fa;
    padding: 16px 18px;
    border-bottom: 2px solid #e8e8e8;
}

.jazital-chat-header-static .jazital-chat-header-heading {
    color: #1f2937;
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
}

.jazital-chat-partner {
    color: #6b7280;
    font-size: 13px;
    margin: 0;
}

/* Conversation View - Always Open */
.jazital-conversation-view .jazital-chat-messages-wrapper {
    background: #fafafa;
    padding: 12px 16px 16px;
}

/* Initiate Chat Container */
.jazital-chat-initiate-container {
    padding: 16px;
    background: #fafafa;
}

.jazital-chat-initiate-container h3 {
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
}

.jazital-chat-initiate-container textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    resize: vertical;
    transition: all 0.15s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.jazital-chat-initiate-container textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.jazital-chat-initiate-container .button {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 10px;
}

.jazital-chat-initiate-container .button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
    word-wrap: break-word;
    animation: messageSlideIn 0.2s ease;
    position: relative;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jazital-chat-message.sent {
    background: #2563eb;
    color: #ffffff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.jazital-chat-message.received {
    background: #f3f4f6;
    color: #1f2937;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.jazital-chat-message-content {
    margin-bottom: 3px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 400;
}

.jazital-chat-message-time {
    font-size: 10px;
    opacity: 0.7;
    font-weight: 500;
}

.jazital-chat-message.received .jazital-chat-message-time {
    color: #6b7280;
}

/* Chat Input Area */
.jazital-chat-input {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: #ffffff;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.jazital-chat-input textarea {
    flex: 1;
    min-height: 38px;
    max-height: 90px;
    padding: 10px 12px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.3;
    resize: none;
    transition: all 0.15s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.jazital-chat-input textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.jazital-chat-input .button {
    background: #2563eb;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.jazital-chat-input .button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.jazital-chat-input .button:active {
    transform: translateY(0);
}

.back-to-chats {
    display: inline-block;
    margin-bottom: 20px;
}

.no-chats {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-size: 16px;
}

/* Admin Chat Sections */

.jazital-admin-chats-section,
.jazital-product-chats-section {
    margin-bottom: 30px;
}

.jazital-section-heading {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2271b1;
}

.admin-chat-item {
    border-left: 4px solid #2271b1;
    background: #f0f6fc;
}

.admin-badge {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 10px;
    vertical-align: middle;
}

.admin-chat-container .jazital-chat-header {
    background: #f0f6fc;
    border-bottom: 2px solid #2271b1;
}

.admin-chat-container .jazital-chat-message.received {
    background: #2271b1;
    color: #fff;
}

.admin-chat-container .jazital-chat-message.sent {
    background: #e3f2fd;
    color: #333;
}

/* Tabbed Chat Interface */

.jazital-chat-tabs-container {
    background: #fff;
    border-radius: 4px;
}

.jazital-chat-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    gap: 10px;
    padding: 0 15px;
}

.jazital-tab-btn {
    background: transparent;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.jazital-tab-btn:hover {
    color: #333;
    background: #f5f5f5;
}

.jazital-tab-btn.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.jazital-tab-btn .count-badge {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 5px;
}

.jazital-tab-btn .count-badge.admin {
    background: #d63638;
}

.jazital-tab-content {
    display: none;
    padding: 20px;
}

.jazital-tab-content.active {
    display: block;
}

.jazital-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.jazital-empty-state p {
    font-size: 16px;
}

/* Message Upload */

.jazital-chat-attachment {
    margin-bottom: 10px;
}

.jazital-image-upload-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.jazital-image-upload-btn:hover {
    background: #e0e0e0;
}

.jazital-chat-message-content {
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
}

.jazital-chat-message.sent .jazital-chat-message-content {
    color: #ffffff;
}

.jazital-chat-message-time {
    font-size: 11px;
    opacity: 0.75;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.jazital-chat-message.sent .jazital-chat-message-time {
    color: rgba(255, 255, 255, 0.8);
}

.jazital-chat-message.received .jazital-chat-message-time {
    color: #7f8c8d;
}

/* Chat Input Area */
.jazital-chat-input {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: #ffffff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.jazital-chat-input textarea {
    flex: 1;
    min-height: 48px;
    max-height: 120px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.jazital-chat-input textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.jazital-chat-input .button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.jazital-chat-input .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.jazital-chat-input .button:active {
    transform: translateY(0);
}

.jazital-image-preview {
    margin-top: 10px;
    max-width: 200px;
}

.jazital-image-preview img {
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Modern Banner Notification */
.jazital-chat-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    animation: bannerSlideIn 0.3s ease;
}

@keyframes bannerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.jazital-chat-banner.warning {
    background: #fff8e5;
    border-left: 4px solid #dba617;
}

.jazital-chat-banner.locked {
    background: #fde7e9;
    border-left: 4px solid #d63638;
}

.jazital-chat-banner .banner-icon {
    font-size: 20px;
    line-height: 1;
}

.jazital-chat-banner .banner-content {
    flex: 1;
}

.jazital-chat-banner .banner-content strong {
    display: block;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
}

.jazital-chat-banner .banner-details {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.jazital-chat-banner .banner-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    line-height: 1;
    transition: color 0.15s ease;
}

.jazital-chat-banner .banner-close:hover {
    color: #1f2937;
}

/* Chat Locked State */
.jazital-chat-input.chat-locked {
    opacity: 0.6;
    pointer-events: none;
}

.jazital-chat-input.chat-locked textarea {
    background: #f3f4f6;
    color: #6b7280;
}

.jazital-chat-input.chat-locked .button {
    background: #9ca3af;
    cursor: not-allowed;
}

.jazital-remove-image {
    background: #d63638;
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 5px;
}

.jazital-remove-image:hover {
    background: #b32d2e;
}