/* Chatterbox Chat Widget Styles */
.chatterbox-widget-container {
    position: fixed;
    bottom: 80px;
    z-index: 9999;
    width: 370px;
    max-width: 90%;
    display: none;
}

.chatterbox-widget-container.right {
    right: 20px;
}

.chatterbox-widget-container.left {
    left: 20px;
}

.chatterbox-btn {
    position: fixed;
    bottom: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.chatterbox-btn:hover {
    transform: scale(1.1);
}

.chatterbox-btn.right {
    right: 20px;
}

.chatterbox-btn.left {
    left: 20px;
}

.chatterbox-btn i {
    font-size: 24px;
    color: white;
}

.chatterbox-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff4c4c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    display: none;
}

.chatterbox-widget {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 450px;
    max-height: 90vh;
}

.chatterbox-header {
    padding: 12px 15px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatterbox-title {
    font-weight: bold;
    font-size: 14px;
	width:70%;
	display:inline-block;
	margin-left:30px;
}

.chatterbox-title i {
    margin-right: 5px;
}

.chatterbox-close {
    cursor: pointer;
    font-size: 20px;
}

.chatterbox-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f5f5f5;
}

.chatterbox-welcome {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    font-size: 13px;
}

.chatterbox-messages {
    margin-bottom: 15px;
}

.chatterbox-message {
    max-width: 80%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 10px;
    position: relative;
    clear: both;
    word-wrap: break-word;
    font-size: 13px;
}

.chatterbox-message.in {
    background-color: #e6f8f1;
    float: right;
    border-bottom-right-radius: 0;
}

.chatterbox-message.out {
    background-color: #E3F2FD;
    color: black;
    float: left;
    border-bottom-left-radius: 0;
}

.chatterbox-time {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 5px;
    text-align: right;
	color:#000000;
}

.chatterbox-message.out .chatterbox-time {
    color: rgba(0, 0, 0, 0.7);
}

.chatterbox-clear {
    clear: both;
}

.chatterbox-registration {
    padding: 15px;
    background-color: white;
    border-radius: 5px;
    margin-bottom: 15px;
}

.chatterbox-registration .form-group {
    margin-bottom: 12px;
}

.chatterbox-registration label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
    font-size: 13px;
}

.chatterbox-registration input,
.chatterbox-registration select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.chatterbox-registration input.error,
.chatterbox-registration select.error {
    border-color: #ff4c4c;
}

.chatterbox-registration button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
}

.chatterbox-footer {
    padding: 10px;
    border-top: 1px solid #eee;
	
}

.chatterbox-input-container {
    display: flex;
    align-items: center;
    gap: 2px;
}

.chatterbox-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
	width:180px;
}

.chatterbox-send {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatterbox-typing {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    display: none;
}

.chatterbox-sender-name {
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 2px;
    opacity: 0.8;
}


/* Emoji-only message styling */
.chatterbox-message-emoji-only {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 5px !important;
    max-width: 100% !important;
}

.chatterbox-message-emoji-only.in {
    float: right !important;
    clear: both;
}

.chatterbox-message-emoji-only.out {
    float: left !important;
    clear: both;
}

.chatterbox-emoji-big {
    font-size: 3.5rem;
    line-height: 1.2;
    display: inline-block;
    padding: 0;
}

/* Adjust size based on number of emojis */
.chatterbox-emoji-big:has(> :nth-child(1):only-child) {
    font-size: 4rem;
}

.chatterbox-emoji-big:has(> :nth-child(2):last-child) {
    font-size: 3.5rem;
}

.chatterbox-emoji-big:has(> :nth-child(3):last-child) {
    font-size: 3rem;
}

/* For the time display in emoji messages */
.chatterbox-message-emoji-only .chatterbox-time {
    margin-top: 2px;
    opacity: 0.6;
    font-size: 10px;
    text-align: right;
    clear: both;
}

/* Optimistic message styling (temporary) */
.chatterbox-message[data-message-id^="temp_"] {
    opacity: 0.8;
}

/* File attachment hover effect */
.file-attachment:hover {
    background: #e8e8e8 !important;
}

/* Image attachment hover effect */
.image-attachment img:hover {
    opacity: 0.9;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* Staff chat message styles with emoji support */
.staff-chat-message {
    max-width: 80%;
    margin-bottom: 10px;
    border-radius: 10px;
    clear: both;
    word-wrap: break-word;
    font-size: 13px;
	padding:5px 3px 0px 5px;
}

.staff-chat-message.mine {
    float: right;
    background: #e6f8f1;
    border-bottom-right-radius: 0;
}

.staff-chat-message.theirs {
    float: left;
    background: #E3F2FD;
    border-bottom-left-radius: 0;
}

.staff-chat-message .message-text {
    padding: 10px;
}

.staff-chat-message .message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 5px;
    padding: 0 10px 10px 10px;
    text-align: right;
}

/* Emoji-only message styling */
.staff-chat-message.emoji-only {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
}

.staff-chat-message.mine.emoji-only {
    float: right;
    clear: both;
}

/* Emoji Picker */
.chatterbox-emoji-picker, .staff-emoji-picker {
    max-height: 260px;
    overflow-y: auto;
	min-width:95% !important;
}

.chatterbox-emoji-picker button:hover,
.staff-emoji-picker button:hover {
    background: #f0f0f0 !important;
    transform: scale(1.2);
}

/* Make emoji-only messages even bigger in both widgets */
.chatterbox-message-emoji-only .chatterbox-emoji-big,
.staff-chat-message.emoji-only .chatterbox-emoji-big {
    font-size: 3.8rem !important;
}

/* Closed chat indicator */
.chatterbox-closed-indicator {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-size: 12px;
    color: #6c757d;
}

.chatterbox-closed-indicator i {
    margin-right: 5px;
}

/* Disabled input styling */
.chatterbox-input:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.chatterbox-emoji-btn, .chatterbox-camera-btn, .chatterbox-camera-btn,.chatterbox-mic-btn,.chatterbox-file-btn{width:30px;height:30px;border:none;border-radius:50%;background:transparent;cursor:pointer;font-size:22px;}
.chatterbox-emoji-btn-item{width:30px;height:30px;border:none;border-radius:50%;background:transparent;cursor:pointer;font-size:22px;}
.chatterbox-send:disabled,
.chatterbox-file-btn:disabled,
.chatterbox-emoji-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Closure message styling */
.chatterbox-message[data-message-id].closure-message {
    background: #fff3cd !important;
    border: 1px solid #ffeeba !important;
    color: #856404 !important;
    font-style: italic;
    text-align: center;
    width: 100% !important;
    max-width: 100% !important;
    margin: 10px 0 !important;
}

/* Recording UI */
.chatterbox-recording-bar,
.staff-recording-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: #fff;
    border: 2px solid #ff3b30;
    border-radius: 30px;
    margin: 5px 0;
    box-shadow: 0 4px 15px rgba(255,59,48,0.3);
}

.recording-dot {
    width: 14px;
    height: 14px;
    background: #ff3b30;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.recording-timer {
    font-family: monospace;
    font-size: 15px;
    font-weight: bold;
    color: #ff3b30;
    min-width: 48px;
}

.recording-stop-btn {
    background: #ff3b30 !important;
    color: white !important;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
}

.recording-cancel-btn {
    background: #ddd !important;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
}

.staff-recording-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: #fff3f3;
    border: 1px solid #ffcccc;
    border-radius: 24px;
    margin: 6px 10px;
}
.recording-dot {
    width: 12px;
    height: 12px;
    background: #ff3b30;
    border-radius: 50%;
    animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% {opacity:1} 50% {opacity:0.4} }
.recording-timer { font-family: monospace; color: #d00; font-weight: bold; }
.recording-stop-btn { background:#ff3b30; color:white; border:none; padding:5px 14px; border-radius:16px; }
.recording-cancel-btn { background:#eee; border:none; padding:5px 14px; border-radius:16px; }

.chatterbox-typing-dots span {
    opacity: 0.3;
    animation: none;
    font-size: 20px;
    line-height: 1;
    display: inline-block;
    transition: opacity 0.3s ease;
}

.chatterbox-typing-dots span:nth-child(1) { animation-delay: 0s; }
.chatterbox-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chatterbox-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Visitor chat file preview */
.chatterbox-file-preview img {
    max-width: 100% !important;
    max-height: 120px !important;
    border-radius: 5px;
    display: block;
    margin: 0 auto;
}

.chatterbox-file-info {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Read receipt styling */
.chatterbox-time {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 5px;
    text-align: right;
    color: #000000;
}

.chatterbox-time span.read-receipt {
    margin-left: 3px;
    font-size: 11px;
}

.chatterbox-time span.read-receipt.read {
    color: #34b7f1; /* Light blue for read receipts */
}

/* For outgoing messages (visitor messages) */
.chatterbox-message.in .chatterbox-time {
    color: rgba(0, 0, 0, 0.6);
}

/* For incoming messages (staff replies) */
.chatterbox-message.out .chatterbox-time {
    color: rgba(0, 0, 0, 0.7);
}
/* Read receipts in staff chat */
.staff-chat-message .message-time span.read-receipt {
    margin-left: 3px;
    font-size: 11px;
}

.staff-chat-message.mine .message-time span.read-receipt.read {
    color: #34b7f1;
}


/* Sender name styling */
.chatterbox-sender-name,
.message-sender {
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 2px;
    opacity: 0.8;
    color: #666;
}

/* For incoming messages (visitor) */
.chatterbox-message.out .chatterbox-sender-name {
    color: #2c3e50;
}

/* For outgoing messages (staff) */
.chatterbox-message.in .chatterbox-sender-name {
    color: #1d7e3a;
}

/* Staff chat sender names */
.staff-chat-message.mine .message-sender {
    color: #1d7e3a;
    text-align: right;
}

.staff-chat-message.theirs .message-sender {
    color: #2c3e50;
    text-align: left;
}

/* System message sender */
.system-message .message-sender {
    color: #856404;
    text-align: center;
    margin-bottom: 5px;
}

/* Emoji-only message adjustments */
.chatterbox-message-emoji-only .chatterbox-sender-name {
    margin-bottom: 5px;
    font-size: 11px;
}

/* Ensure sender name doesn't interfere with message bubble */
.chatterbox-message {
    position: relative;
}

.chatterbox-message .chatterbox-sender-name {
    margin-bottom: 4px;
}

.staff-profile-image-thumb{width:70px;height:70px;border:5px solid #E0E0DE;position:fixed;margin-left:-50px !important;margin-top:-20px !important;}

/* Responsive adjustments */
@media (max-width: 480px) {
    .chatterbox-widget-container {
        width: 300px;
    }
}
