/* WhatsApp-style Chat Application */
        
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #111;
    background-color: #111;
    overflow: hidden;
    height: 100vh;
}

/* WhatsApp Color Variables */
:root {
    --whatsapp-teal: #075E54;
    --whatsapp-teal-dark: #054d44;
    --whatsapp-green: #25D366;
    --whatsapp-light-green: #DCF8C6;
    --whatsapp-blue: #34B7F1;
    --whatsapp-grey: #ECE5DD;
    --whatsapp-dark-grey: #d9d9d9;
    --sidebar-bg: #f8f9fa;
    --message-bg-received: #FFFFFF;
    --message-bg-sent: #DCF8C6;
    --header-bg: #ededed;
    --border-color: #e9edef;
}

.containers {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100%;
    background-color: #111;
    overflow: hidden;
}

/* Left Sidebar - Chat List */
.chat-list {
    width: 400px;
    min-width: 320px;
    max-width: 450px;
    background-color: #fff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-list-header {
    background-color: var(--header-bg);
    padding: 15px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    border-bottom: 1px solid var(--border-color);
}

.chat-list-title {
    font-size: 19px;
    font-weight: 600;
    color: #111;
}

.users-inbox {
    background: #fff;
    padding: 8px;
    flex: 1;
    overflow-y: auto;
}

#chat-users-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 10px;
    outline: none;
    background-color: #f6f6f6;
}

#chat-users-input:focus {
    background-color: #fff;
    border-color: var(--whatsapp-teal);
}

.container-inbox {
    flex-direction: column;
    display: flex;
    overflow-x: hidden;
}

.inbox-select {
    width: 100% !important;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
    outline: none;
}

.online-status, .offline-status {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    width: 100%;
    font-size: 16px;
    border-radius: 0;
}

.online-status:hover, .offline-status:hover {
    background-color: #f5f5f5;
}

.online-status {
    color: #111;
}

.offline-status {
    color: #667781;
}

.dot_online {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    display: inline-block;
    background-color: var(--whatsapp-green);
    margin-left: 8px;
    position: absolute;
    right: 15px;
}

/* Right Panel - Chat Area */
.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #e5ddd5;
    position: relative;
}

/* WhatsApp Background Pattern */
.right-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 30L0 60M30 30L0 0M30 30l30 30M30 30l30-30' stroke='%23d9d9d9' stroke-width='1' fill='none' opacity='0.1'/%3E%3C/svg%3E");
    background-size: 300px 300px;
    opacity: 0.5;
    pointer-events: none;
}

/* Header */
.header {
    background-color: var(--header-bg);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    min-height: 60px;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    flex: 1;
}

/* Mobile back button - hidden by default on desktop */
.mobile-back-btn {
    display: none;
}

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: #fff;
    font-weight: 500;
    background: linear-gradient(135deg, var(--whatsapp-teal), var(--whatsapp-green));
}

.header-info {
    flex: 1;
}

.header-name {
    font-size: 16px;
    font-weight: 500;
    color: #111;
}

.header-status {
    font-size: 13px;
    color: #667781;
}

/* Messages Area */
.message-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 8% 20px;
    position: relative;
    z-index: 1;
}

.rce-container-mlist {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rce-mlist {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
}

#container_inbox {
    display: flex;
    flex-direction: column;
}

.container-message {
    margin: 5px 0;
}

.rce-container-mbox {
    display: flex;
    flex-direction: column;
    margin: 2px 0;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Message Bubbles */
.rce-inbox {
    position: relative;
    background: var(--message-bg-received);
    border-radius: 8px;
    padding: 6px 7px 8px 9px;
    max-width: 65%;
    margin: 2px 0;
    align-self: flex-start;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
    word-wrap: break-word;
}

.rce-inbox.rce-inbox-right {
    background: var(--message-bg-sent);
    align-self: flex-end;
    margin-left: auto;
}

.rce-inbox-body {
    margin: 0;
    padding: 0;
    position: relative;
}

.rce-inbox-title {
    margin: 0 0 2px;
    font-weight: 500;
    font-size: 12.5px;
    color: var(--whatsapp-teal);
    display: flex;
    align-items: center;
}

.rce-inbox-right .rce-inbox-title {
    color: #128C7E;
}

.rce-avatar-container {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 5px;
    background: linear-gradient(135deg, var(--whatsapp-teal), var(--whatsapp-green));
    color: #fff;
    font-size: 10px;
}

.rce-avatar-container i {
    font-size: 11px;
}

.message-text {
    font-size: 14.2px;
    line-height: 19px;
    color: #111;
    margin: 0;
    padding-right: 50px;
}

.rce-inbox img {
    max-width: 100%;
    border-radius: 8px;
    margin-top: 5px;
}

.issue_footnote {
    font-size: 11px;
    color: #667781;
    text-align: right;
    margin-top: 4px;
    padding-right: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    animation: fadeInTime 0.3s ease-in;
}

.message-time {
    font-size: 11px;
    color: #667781;
    position: absolute;
    right: 7px;
    bottom: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.message-check {
    color: #53bdeb;
    font-size: 16px;
    line-height: 15px;
}

/* Notches removed for cleaner look */
.rce-inbox-left-notch,
.rce-inbox-right-notch {
    display: none;
}

/* Input Area */
.rce-container-input {
    background: #f0f0f0;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border-color);
    z-index: 100;
}

.chat-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0;
    height: auto;
}

.texty_input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 21px;
    font-size: 15px;
    outline: none;
    background-color: #fff;
    font-family: inherit;
}

.texty_input:focus {
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

#imageInput {
    font-size: 24px;
    color: #667781;
    cursor: pointer;
    width: auto;
    transition: color 0.2s;
}

#imageInput:hover {
    color: var(--whatsapp-teal);
}

::-webkit-file-upload-button {
    display: none;
}

#chat-message-submit {
    background-color: var(--whatsapp-green);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 20px;
    margin: 0;
    padding: 0;
}

#chat-message-submit:hover {
    background-color: #20c05c;
}

#chat-message-submit i {
    margin: 0;
}

/* Typing Indicator */
.typing {
    font-size: 13px;
    color: var(--whatsapp-green);
    font-style: italic;
    padding: 5px 16px;
    position: absolute;
    bottom: 70px;
    left: 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Dropdown Menu */
.dropdown-menu {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    padding: 5px 0;
}

button#dLabel {
    background: transparent;
    border: none;
    color: #667781;
    padding: 2px 5px;
    cursor: pointer;
    font-size: 12px;
}

button#dLabel:hover {
    background: transparent;
    color: var(--whatsapp-teal);
}

.dropdown-menu form {
    padding: 0;
    margin: 0;
}

.dropdown-menu button {
    width: 100%;
    text-align: left;
    padding: 8px 16px;
    border: none;
    /* background: transparent; */
    cursor: pointer;
    font-size: 14px;
}

.dropdown-menu button:hover {
    background-color: #f5f5f5;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: #fff;
    color: #111;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    min-width: 250px;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-default {
    background-color: #fff;
    color: var(--whatsapp-teal);
    border: 1px solid var(--border-color);
}

.btn-default:hover {
    background-color: #f5f5f5;
}

.btn-primary {
    background-color: var(--whatsapp-green);
    color: #fff;
}

.btn-primary:hover {
    background-color: #20c05c;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-sm {
    font-size: 12px;
    padding: 5px 10px;
}

/* Logout Button */
.chat-list form[method="post"] {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
}

.chat-list form[method="post"] button {
    width: 100%;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Editable */
.editable-click, a.editable-click, a.editable-click:hover {
    border-bottom: none;
    color: inherit;
    text-decoration: none;
}

.editable-container {
    left: 0 !important;
}

/* User Avatar in Chat List */
.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--whatsapp-teal), var(--whatsapp-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    margin-right: 12px;
}

/* Message Status Icons */
.message-status {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    color: #667781;
}

.message-status.delivered {
    color: #667781;
}

.message-status.read {
    color: #53bdeb;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #667781;
    text-align: center;
    padding: 40px;
}

.welcome-screen i {
    font-size: 120px;
    color: #d9d9d9;
    margin-bottom: 30px;
}

.welcome-screen h2 {
    font-size: 32px;
    color: #111;
    font-weight: 300;
    margin-bottom: 15px;
}

.welcome-screen p {
    font-size: 14px;
    color: #667781;
    line-height: 20px;
}

/* Link Styling */
a {
    color: var(--whatsapp-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Message Input Focus Animation */
.texty_input:focus {
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transform: scale(1.005);
    transition: all 0.2s ease;
}

/* Hover Effects for Interactive Elements */
.rce-avatar-container:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.header-avatar:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Message Time Fade In */
@keyframes fadeInTime {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Improved Select Box */
.inbox-select {
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
}

.inbox-select option {
    padding: 12px 15px;
}

/* Emoji Support */
.message-text {
    word-break: break-word;
    white-space: pre-wrap;
}

/* Image Preview in Messages */
.rce-inbox img {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.rce-inbox img:hover {
    transform: scale(1.02);
}

/* Better Dropdown Positioning */
.dropdown-menu {
    min-width: 120px;
    margin-top: 5px;
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

/* Tooltip for Icons */
[title] {
    cursor: help;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--whatsapp-green);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .chat-list,
    .header,
    .rce-container-input,
    #toast-container {
        display: none;
    }
    
    .right-panel {
        width: 100%;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Keep light mode for WhatsApp consistency */
}

/* Responsive Design */
@media (max-width: 1024px) {
    .message-list {
        padding: 20px 5%;
    }
}

@media (max-width: 768px) {
    .chat-list {
        width: 100%;
        max-width: 100%;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
        transition: transform 0.3s ease-in-out;
    }
    
    /* Hide chat list when chat is active */
    .chat-list.chat-active {
        transform: translateX(-100%);
    }
    
    .right-panel {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 101;
        width: 100%;
        transition: transform 0.3s ease-in-out;
        transform: translateX(100%);
    }
    
    /* Show right panel when chat is active */
    .right-panel.chat-active {
        display: flex;
        transform: translateX(0);
    }
    
    .message-list {
        padding: 15px 4%;
    }
    
    .rce-inbox {
        max-width: 85%;
    }
    
    .header-avatar {
        width: 35px;
        height: 35px;
    }
    
    .chat-list-header .header-avatar {
        width: 35px;
        height: 35px;
    }
    
    /* Back button for mobile */
    .mobile-back-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        color: #54656f;
        font-size: 20px;
        cursor: pointer;
        margin-right: 10px;
        border-radius: 50%;
        transition: background-color 0.2s;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-back-btn:active {
        background-color: rgba(0, 0, 0, 0.05);
    }
}

@media (max-width: 480px) {
    .rce-inbox {
        max-width: 90%;
        font-size: 13px;
    }
    
    .message-text {
        font-size: 13.5px;
    }
    
    .texty_input {
        font-size: 14px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .rce-inbox {
        box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    }
}

/* ==========================
   GROUP CHAT STYLES
   ========================== */

/* Tabs for Users and Groups */
.chat-tabs {
    display: flex;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

.tab-button {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #667781;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.tab-button.active {
    color: var(--whatsapp-teal);
    border-bottom-color: var(--whatsapp-teal);
}

.tab-button i {
    font-size: 16px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Groups Inbox */
.groups-inbox {
    background: #fff;
    padding: 8px;
    flex: 1;
    overflow-y: auto;
}

.groups-header {
    padding: 8px 0;
    margin-bottom: 10px;
}

.groups-header button {
    width: 100%;
}

#chat-groups-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 10px;
    outline: none;
    background-color: #f6f6f6;
}

#chat-groups-input:focus {
    background-color: #fff;
    border-color: var(--whatsapp-teal);
}

/* Users List */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
    position: relative;
}

.user-item:hover {
    background-color: #f5f5f5;
}

.user-item.active {
    background-color: #e8f5e9;
}

.user-item.online {
    color: #111;
}

.user-item.offline {
    color: #667781;
}

.user-item-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--whatsapp-teal), var(--whatsapp-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    margin-right: 12px;
    flex-shrink: 0;
}

.user-item-info {
    flex: 1;
    min-width: 0;
}

.user-item-name {
    font-size: 16px;
    font-weight: 500;
    color: #111;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-item-status {
    font-size: 13px;
    color: #667781;
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-item .dot_online {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* Groups List */
.groups-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.group-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
}

.group-item:hover {
    background-color: #f5f5f5;
}

.group-item.active {
    background-color: #e8f5e9;
}

.group-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--whatsapp-teal), var(--whatsapp-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    margin-right: 12px;
    flex-shrink: 0;
}

.group-info {
    flex: 1;
    min-width: 0;
}

.group-name {
    font-size: 16px;
    font-weight: 500;
    color: #111;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-meta {
    font-size: 13px;
    color: #667781;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #111;
}

.close-modal {
    color: #667781;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: #111;
}

.modal-body {
    padding: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #111;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--whatsapp-teal);
    box-shadow: 0 0 0 2px rgba(7, 94, 84, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Members Selector */
.members-selector {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.member-item:hover {
    background-color: #f5f5f5;
}

.member-item input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.member-item label {
    flex: 1;
    cursor: pointer;
    margin: 0;
    font-weight: normal;
    display: flex;
    align-items: center;
}

.member-avatar-small {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--whatsapp-teal), var(--whatsapp-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    margin-right: 10px;
}

.member-name {
    font-size: 14px;
    color: #111;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-actions button {
    min-width: 100px;
}

/* Group Message Badge */
.group-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(7, 94, 84, 0.1);
    color: var(--whatsapp-teal);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 5px;
}

/* Admin Badge */
.admin-badge {
    display: inline-flex;
    align-items: center;
    color: #FFD700;
    font-size: 12px;
    margin-left: 5px;
    animation: fadeIn 0.3s ease-in;
}

.admin-badge i {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Group Message Styling */
.rce-inbox.group-message {
    max-width: 75%;
}

.rce-inbox.group-message .rce-inbox-title {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
}

.group-message-indicator {
    font-size: 11px;
    color: var(--whatsapp-teal);
    margin-left: 5px;
    font-weight: 600;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #667781;
}

.empty-state i {
    font-size: 60px;
    color: #d9d9d9;
    margin-bottom: 15px;
}

.empty-state h4 {
    font-size: 18px;
    font-weight: 500;
    color: #111;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: #667781;
}

/* Group Info Badge in Chat Header */
.header-group-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-group-badge {
    background-color: rgba(37, 211, 102, 0.15);
    color: var(--whatsapp-green);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Responsive Updates for Groups */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .group-avatar {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .tab-button {
        font-size: 13px;
        padding: 10px 12px;
    }
}

.btn_info .btn-block {
    margin-top: 14px;
}

/* ===== STATUS STYLES ===== */

/* Status Tab Content */
.status-inbox {
    background: #fff;
    padding: 0;
    flex: 1;
    overflow-y: auto;
}

.status-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg);
}

.status-header .btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
}

/* Status Sections */
.my-status-section {
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-color);
}

.status-section {
    padding: 8px 16px;
}

.status-section-title {
    padding: 8px 0;
    font-size: 13px;
    color: #667781;
    font-weight: 500;
    text-transform: uppercase;
}

/* Status Item */
.status-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.status-item:hover {
    background-color: #f5f6f6;
}

.status-item.viewed {
    opacity: 0.7;
}

.status-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--whatsapp-teal), var(--whatsapp-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-right: 12px;
    flex-shrink: 0;
}

.status-ring {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    padding: 3px;
}

.status-ring.unviewed,
.status-ring.has-status {
    background: linear-gradient(135deg, var(--whatsapp-green), var(--whatsapp-teal));
}

.status-ring.has-status::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    right: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
}

.my-status .status-avatar {
    background: #ddd;
    color: #667781;
}

.status-info {
    flex: 1;
    min-width: 0;
}

.status-name {
    font-size: 16px;
    font-weight: 500;
    color: #111;
    margin-bottom: 2px;
}

.status-time {
    font-size: 13px;
    color: #667781;
}

/* Status Creation Modal */
.status-type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.status-type-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #667781;
}

.status-type-btn:hover {
    border-color: var(--whatsapp-teal);
}

.status-type-btn.active {
    background-color: var(--whatsapp-teal);
    border-color: var(--whatsapp-teal);
    color: white;
}

.status-form-type {
    display: none;
}

.status-form-type.active {
    display: block;
}

.char-count {
    display: block;
    text-align: right;
    color: #667781;
    font-size: 12px;
    margin-top: 5px;
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    border-color: #111;
    box-shadow: 0 0 0 2px white, 0 0 0 4px #111;
}

/* Image Upload */
.image-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #667781;
}

.image-upload-label:hover {
    border-color: var(--whatsapp-teal);
    color: var(--whatsapp-teal);
}

.image-upload-label i {
    font-size: 48px;
    margin-bottom: 10px;
}

.image-preview {
    margin-top: 15px;
}

.image-preview img {
    max-width: 100%;
    border-radius: 8px;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #667781;
    font-size: 14px;
}

.loading-indicator i {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--whatsapp-teal);
}

/* Status Viewer Modal */
.status-viewer {
    background-color: #111;
    padding: 0;
    max-width: 450px;
    width: 100%;
    border-radius: 0;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
}

.status-viewer-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 100%);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.status-viewer-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 500;
}

.status-viewer-user i {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-viewer-time {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.status-viewer-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.status-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.status-text {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: white;
    font-size: 24px;
    text-align: center;
    word-wrap: break-word;
}

.status-viewer-footer {
    padding: 20px;
    background: linear-gradient(0deg, rgba(0,0,0,0.6) 0%, transparent 100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.status-viewer-nav {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.status-progress {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: white;
    transition: width 0.3s;
}

.status-viewer-info {
    color: white;
    font-size: 14px;
}

.view-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-count i {
    font-size: 16px;
}

/* Close button for status viewer */
#status-viewer-modal .close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 32px;
    cursor: pointer;
    z-index: 11;
    background: rgba(0, 0, 0, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

#status-viewer-modal .close-modal:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #667781;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 8px;
    color: #111;
}

.empty-state p {
    font-size: 14px;
}

/* Status Reply Container */
.status-reply-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.status-reply-input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 21px;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    font-size: 15px;
    outline: none;
    font-family: inherit;
}

.status-reply-input::placeholder {
    color: #667781;
}

.status-reply-input:focus {
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.status-reply-send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background-color: var(--whatsapp-green);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 18px;
}

.status-reply-send-btn:hover {
    background-color: #20c05c;
}

.status-reply-send-btn:disabled {
    background-color: #999;
    cursor: not-allowed;
}

.status-reply-send-btn i {
    margin: 0;
}

/* Status Modal Responsive */
@media (max-width: 768px) {
    .status-viewer {
        max-width: 100%;
    }
    
    .status-text {
        font-size: 20px;
        padding: 30px;
    }
    
    .status-reply-container {
        padding: 12px 15px;
    }
    
    .status-reply-input {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .status-reply-send-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* ===== REPLY MESSAGE STYLES ===== */

/* Reply Preview in Input Area */
#reply-preview {
    padding: 10px 12px;
    background: #f0f2f5;
    border-left: 3px solid var(--whatsapp-teal);
    margin-bottom: 8px;
    border-radius: 5px;
    display: none;
    transition: all 0.2s;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#reply-preview .reply-header {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    font-size: 12px;
    color: var(--whatsapp-teal);
    margin-bottom: 3px;
}

#reply-preview .reply-header i {
    font-size: 12px;
}

#reply-preview .reply-text {
    font-size: 13px;
    color: #667781;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

#reply-preview button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #667781;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 28px;
    height: 28px;
}

#reply-preview button:hover {
    color: #111;
    background: rgba(0, 0, 0, 0.05);
}

#reply-preview button i {
    font-size: 14px;
}

/* Reply Reference in Messages */
.reply-reference {
    background: rgba(0, 0, 0, 0.05);
    border-left: 3px solid var(--whatsapp-teal);
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.2s;
}

.reply-reference:hover {
    background: rgba(0, 0, 0, 0.08);
}

.rce-inbox-right .reply-reference {
    background: rgba(0, 0, 0, 0.08);
    border-left-color: #128c7e;
}

.rce-inbox-right .reply-reference:hover {
    background: rgba(0, 0, 0, 0.12);
}

.reply-reference .reply-username {
    font-weight: bold;
    font-size: 12px;
    color: var(--whatsapp-teal);
    margin-bottom: 3px;
    display: block;
}

.rce-inbox-right .reply-reference .reply-username {
    color: #128c7e;
}

.reply-reference .reply-message-text {
    font-size: 13px;
    color: #667781;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Reply Button in Dropdown */
.reply-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #111;
    transition: color 0.2s;
}

.reply-btn:hover {
    color: var(--whatsapp-teal);
}

.reply-btn i {
    font-size: 14px;
}

/* Message Highlight Animation (when scrolling to replied message) */
.message-highlight {
    animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
    0% {
        background-color: rgba(255, 255, 0, 0.3);
    }
    50% {
        background-color: rgba(255, 255, 0, 0.15);
    }
    100% {
        background-color: transparent;
    }
}

/* Reply Indicator Icon in Message List */
.reply-indicator {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: var(--whatsapp-teal);
    margin-right: 5px;
}

.reply-indicator i {
    font-size: 10px;
}

/* Responsive Adjustments for Reply Feature */
@media (max-width: 768px) {
    #reply-preview {
        padding: 8px 10px;
        margin-bottom: 6px;
    }
    
    #reply-preview .reply-header {
        font-size: 11px;
    }
    
    #reply-preview .reply-text {
        font-size: 12px;
    }
    
    .reply-reference {
        padding: 6px 8px;
        margin-bottom: 6px;
    }
    
    .reply-reference .reply-username {
        font-size: 11px;
    }
    
    .reply-reference .reply-message-text {
        font-size: 12px;
    }
}

/* ============================================
   VIDEO CALL STYLES
   ============================================ */

/* Header Actions (Video/Audio Call Buttons) */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    color: #54656f;
    font-size: 20px;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.btn-icon:hover {
    background-color: #f0f2f5;
    color: var(--whatsapp-teal);
}

.btn-icon:active {
    background-color: #d9d9d9;
}

/* Video Call Modal */
.video-call-modal {
    z-index: 10000;
}

.video-call-modal .video-call-container {
    background: #1e1e1e;
    border-radius: 12px;
    width: 90vw;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.video-call-header {
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.call-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.caller-name {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

.call-status {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.btn-close-call {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-close-call:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Video Container */
.video-container {
    position: relative;
    flex: 1;
    background: #000;
    overflow: hidden;
}

#remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

#local-video {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 250px;
    height: 180px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: #2a2a2a;
    z-index: 10;
}

.call-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 5;
}

.call-overlay.hidden {
    display: none;
}

.call-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.call-avatar i {
    font-size: 60px;
    color: #fff;
}

.call-overlay-text {
    color: #fff;
    font-size: 20px;
    font-weight: 500;
    animation: pulse 2s infinite;
}

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

/* Video Call Controls */
.video-call-controls {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(10px);
}

.call-control-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.call-control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.call-control-btn:active {
    transform: scale(0.95);
}

.call-control-btn.disabled {
    background: rgba(220, 53, 69, 0.8);
}

.call-control-btn.disabled:hover {
    background: rgba(220, 53, 69, 1);
}

.btn-end-call {
    background: #dc3545;
}

.btn-end-call:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Incoming Call Modal */
.incoming-call-modal {
    z-index: 10001;
}

.incoming-call-container {
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    border-radius: 16px;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 350px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.incoming-call-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ringPulse 1s infinite;
}

@keyframes ringPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
    }
}

.incoming-call-avatar i {
    font-size: 50px;
    color: #fff;
}

.incoming-call-info {
    text-align: center;
}

.incoming-caller-name {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}

.incoming-call-type {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}

.incoming-call-actions {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.call-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    cursor: pointer;
    transition: all 0.3s;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.call-action-btn i {
    font-size: 28px;
}

.call-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-accept {
    background: #25D366;
}

.btn-accept:hover {
    background: #20bd5a;
}

.btn-reject {
    background: #dc3545;
}

.btn-reject:hover {
    background: #c82333;
}

/* Responsive Design for Video Calls */
@media (max-width: 768px) {
    /* Full screen video call on mobile */
    .video-call-modal .video-call-container {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    /* Smaller local video for mobile */
    #local-video {
        width: 100px;
        height: 75px;
        top: 80px;
        right: 10px;
        border-radius: 8px;
        border-width: 1px;
    }
    
    /* Mobile-optimized video call header */
    .video-call-header {
        padding: 12px 15px;
        min-height: 60px;
    }
    
    .caller-name {
        font-size: 16px;
    }
    
    .call-status {
        font-size: 12px;
    }
    
    /* Larger touch targets for mobile */
    .call-control-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn-end-call {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
    
    .video-call-controls {
        gap: 12px;
        padding: 20px 10px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    
    /* Mobile incoming call modal */
    .incoming-call-container {
        min-width: 85vw;
        max-width: 90vw;
        padding: 35px 25px;
        margin: 0 15px;
    }
    
    .incoming-call-avatar {
        width: 90px;
        height: 90px;
    }
    
    .incoming-call-avatar i {
        font-size: 45px;
    }
    
    .incoming-caller-name {
        font-size: 22px;
    }
    
    .incoming-call-type {
        font-size: 14px;
    }
    
    .call-action-btn {
        padding: 16px 24px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        min-width: 120px;
    }
    
    .call-action-btn i {
        font-size: 26px;
    }
    
    .call-action-btn span {
        font-size: 13px;
    }
    
    /* Header actions for mobile */
    .header-actions {
        gap: 8px;
    }
    
    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        padding: 6px;
    }
    
    /* Call overlay adjustments */
    .call-avatar {
        width: 100px;
        height: 100px;
    }
    
    .call-avatar i {
        font-size: 50px;
    }
    
    .call-overlay-text {
        font-size: 18px;
    }
    
    /* Minimized call indicator on mobile */
    .call-minimized-indicator {
        bottom: 15px;
        right: 15px;
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Small phones (iPhone SE, older devices) */
@media (max-width: 375px) {
    #local-video {
        width: 80px;
        height: 60px;
        top: 70px;
        right: 8px;
    }
    
    .call-control-btn {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }
    
    .btn-end-call {
        width: 65px;
        height: 65px;
        font-size: 26px;
    }
    
    .video-call-controls {
        gap: 10px;
        padding: 15px 8px;
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }
    
    .incoming-call-container {
        min-width: 90vw;
        padding: 30px 20px;
    }
    
    .incoming-call-avatar {
        width: 80px;
        height: 80px;
    }
    
    .incoming-call-avatar i {
        font-size: 40px;
    }
    
    .incoming-caller-name {
        font-size: 20px;
    }
    
    .call-action-btn {
        padding: 14px 20px;
        min-width: 110px;
    }
    
    .call-action-btn i {
        font-size: 24px;
    }
    
    .caller-name {
        font-size: 15px;
    }
    
    .call-status {
        font-size: 11px;
    }
}

/* Landscape mode on mobile */
@media (max-width: 915px) and (orientation: landscape) {
    #local-video {
        width: 120px;
        height: 90px;
        top: 10px;
        right: 10px;
    }
    
    .video-call-header {
        padding: 8px 15px;
        min-height: 50px;
    }
    
    .video-call-controls {
        padding: 12px 10px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    
    .call-control-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .btn-end-call {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    
    .caller-name {
        font-size: 15px;
    }
    
    .call-status {
        font-size: 11px;
    }
}

/* Tablet devices */
@media (min-width: 769px) and (max-width: 1024px) {
    .video-call-modal .video-call-container {
        width: 95vw;
        height: 90vh;
    }
    
    #local-video {
        width: 200px;
        height: 150px;
        top: 15px;
        right: 15px;
    }
    
    .call-control-btn {
        width: 58px;
        height: 58px;
        font-size: 24px;
    }
    
    .video-call-controls {
        gap: 18px;
    }
}

/* Safe area handling for notched devices */
@supports (padding: max(0px)) {
    .video-call-header {
        padding-top: max(15px, env(safe-area-inset-top));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    .video-call-controls {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }
    
    #local-video {
        right: max(10px, env(safe-area-inset-right));
    }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .call-control-btn,
    .btn-icon,
    .call-action-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Remove hover states on touch devices */
    .call-control-btn:hover,
    .btn-icon:hover,
    .call-action-btn:hover {
        transform: none;
    }
    
    /* Active states for touch feedback */
    .call-control-btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
    
    .btn-icon:active {
        transform: scale(0.9);
        opacity: 0.7;
    }
    
    .call-action-btn:active {
        transform: scale(0.95);
        opacity: 0.9;
    }
}

/* Prevent text selection during calls on mobile */
.video-call-modal,
.incoming-call-modal {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    .video-container video {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Fix for iOS video aspect ratio */
    #remote-video,
    #local-video {
        object-position: center;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .call-control-btn,
    .btn-icon {
        border: 0.5px solid rgba(255, 255, 255, 0.1);
    }
}

/* Minimized call indicator */
.call-minimized-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--whatsapp-teal);
    color: #fff;
    padding: 12px 20px;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.call-minimized-indicator:hover {
    background: var(--whatsapp-teal-dark);
}

.call-minimized-indicator i {
    font-size: 18px;
}

.call-minimized-time {
    font-size: 14px;
    font-weight: 500;
}

/* ============================================
   MOBILE CHAT INPUT OPTIMIZATIONS
   ============================================ */

/* Mobile chat input area - applies to all mobile devices */
@media (max-width: 768px) {
    /* Input container optimization */
    .rce-container-input {
        padding: 8px 12px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        position: sticky;
        bottom: 0;
        background: #f0f2f5;
        z-index: 1000;
        gap: 8px;
        box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.05);
    }
    
    /* Chat toolbar */
    .chat-toolbar {
        gap: 8px;
        align-items: flex-end;
    }
    
    /* Message input field */
    .texty_input,
    #chat-message-input {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 10px 14px;
        border-radius: 20px;
        line-height: 1.4;
        max-height: 120px;
        min-height: 40px;
        resize: none;
        overflow-y: auto;
        -webkit-appearance: none;
        appearance: none;
        background-color: #fff;
    }
    
    /* Attachment button (paperclip) */
    .chat-toolbar label {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        border-radius: 50%;
        transition: background-color 0.2s;
    }
    
    .chat-toolbar label:active {
        background-color: rgba(0, 0, 0, 0.05);
    }
    
    .chat-toolbar label i {
        font-size: 22px;
        color: #667781;
    }
    
    /* Send button */
    #chat-message-submit {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        font-size: 18px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
    }
    
    #chat-message-submit:active {
        transform: scale(0.95);
    }
    
    /* Image input */
    #imageInput {
        font-size: 22px;
    }
}

/* Small mobile phones */
@media (max-width: 375px) {
    .rce-container-input {
        padding: 6px 10px;
        padding-bottom: max(6px, env(safe-area-inset-bottom));
        gap: 6px;
    }
    
    .chat-toolbar {
        gap: 6px;
    }
    
    .texty_input,
    #chat-message-input {
        font-size: 16px !important;
        padding: 8px 12px;
        min-height: 38px;
    }
    
    #chat-message-submit {
        min-width: 42px;
        min-height: 42px;
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
    
    .chat-toolbar label {
        min-width: 42px;
        min-height: 42px;
    }
    
    .chat-toolbar label i {
        font-size: 20px;
    }
}

/* Landscape mode adjustments */
@media (max-width: 915px) and (orientation: landscape) {
    .rce-container-input {
        padding: 6px 12px;
        padding-bottom: max(6px, env(safe-area-inset-bottom));
    }
    
    .texty_input,
    #chat-message-input {
        max-height: 80px;
        min-height: 36px;
        padding: 8px 12px;
    }
}

/* Reply preview on mobile */
@media (max-width: 768px) {
    #reply-preview {
        margin: 0 -12px 8px;
        padding: 8px 12px;
        border-radius: 0;
        background: rgba(7, 94, 84, 0.05);
    }
    
    #reply-preview .reply-header {
        font-size: 11px;
        margin-bottom: 3px;
    }
    
    #reply-preview .reply-text {
        font-size: 13px;
        line-height: 1.3;
    }
    
    #cancel-reply {
        min-width: 32px;
        min-height: 32px;
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
}

/* ============================================
   FILE ATTACHMENT STYLES
   ============================================ */

/* File Preview Container (before sending) */
#file-preview-container {
    padding: 10px 15px;
    background: #f0f2f5;
    border-top: 1px solid var(--border-color);
    animation: slideDown 0.3s ease-out;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.file-preview-image {
    max-width: 80px;
    max-height: 80px;
    border-radius: 6px;
    object-fit: cover;
}

.file-preview-document {
    padding: 15px;
}

.file-icon-large {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--whatsapp-teal);
    border-radius: 8px;
    color: #fff;
    font-size: 24px;
}

.file-preview-info {
    flex: 1;
    min-width: 0;
}

.file-preview-info .file-name {
    font-weight: 500;
    color: #111;
    word-break: break-word;
    margin-bottom: 4px;
}

.file-preview-info .file-size {
    font-size: 12px;
    color: #667781;
}

.file-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.file-preview-remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* File Attachments in Messages */
.message-file-container {
    margin: 8px 0;
    max-width: 100%;
}

.message-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    transition: transform 0.2s;
}

.message-image:hover {
    transform: scale(1.02);
}

.message-video {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    background: #000;
    display: block;
}

.message-audio-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
}

.audio-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--whatsapp-teal);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.message-audio {
    flex: 1;
    max-width: 100%;
    height: 40px;
}

.message-document-container {
    margin: 5px 0;
}

.message-document {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.message-document:hover {
    background: rgba(0, 0, 0, 0.06);
}

.document-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--whatsapp-teal);
    border-radius: 8px;
    color: #fff;
    font-size: 22px;
    flex-shrink: 0;
}

.document-info {
    flex: 1;
    min-width: 0;
}

.document-info .file-name {
    font-weight: 500;
    color: #111;
    word-break: break-word;
    margin-bottom: 3px;
    font-size: 14px;
}

.document-info .file-size {
    font-size: 12px;
    color: #667781;
}

.download-icon {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--whatsapp-teal);
    font-size: 18px;
    flex-shrink: 0;
}

.message-file-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 12px;
    color: #667781;
}

.message-file-info .file-name {
    font-weight: 500;
    color: #111;
    word-break: break-word;
}

.message-file-info .file-size {
    color: #667781;
}

/* File type specific colors */
.fa-file-pdf {
    color: #e74c3c;
}

.fa-file-word {
    color: #2980b9;
}

.fa-file-excel {
    color: #27ae60;
}

.fa-file-powerpoint {
    color: #e67e22;
}

.fa-file-archive {
    color: #95a5a6;
}

.fa-file-video {
    color: #9b59b6;
}

.fa-file-audio {
    color: #1abc9c;
}

.fa-file-image {
    color: #3498db;
}

/* Mobile optimizations for file attachments */
@media (max-width: 768px) {
    .file-preview-item {
        padding: 10px;
        gap: 10px;
    }
    
    .file-preview-image {
        max-width: 60px;
        max-height: 60px;
    }
    
    .file-icon-large {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .message-image {
        max-height: 300px;
    }
    
    .message-video {
        max-height: 300px;
    }
    
    .message-audio {
        height: 35px;
    }
    
    .document-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .message-document {
        padding: 10px;
        gap: 10px;
    }
    
    .download-icon {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}

/* Typing indicator on mobile */
@media (max-width: 768px) {
    #typing-status {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Fix iOS keyboard push up */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        .rce-container-input {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100%;
        }
        
        /* Add padding to message list to prevent overlap */
        .rce-container-mlist {
            padding-bottom: 70px;
        }
    }
}

/* Android keyboard handling */
@media (max-width: 768px) {
    /* Ensure input area stays visible */
    .rce-container-input {
        position: sticky;
        bottom: 0;
    }
    
    /* Smooth scroll to input when focused */
    .texty_input:focus,
    #chat-message-input:focus {
        scroll-margin-bottom: 80px;
    }
}

/* Touch-optimized input interactions */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .chat-toolbar label,
    #chat-message-submit {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Better feedback on touch */
    .chat-toolbar label:active,
    #chat-message-submit:active {
        opacity: 0.8;
    }
    
    /* Prevent double-tap zoom on buttons */
    .chat-toolbar label,
    #chat-message-submit,
    #cancel-reply {
        touch-action: manipulation;
        user-select: none;
        -webkit-user-select: none;
    }
}

/* High DPI mobile screens */
@media (max-width: 768px) and (-webkit-min-device-pixel-ratio: 2) {
    .texty_input,
    #chat-message-input {
        border: 0.5px solid rgba(0, 0, 0, 0.05);
    }
}

/* Dark mode support for mobile (optional) */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
    .rce-container-input {
        background: #1e1e1e;
        border-top-color: #2a2a2a;
    }
    
    .texty_input,
    #chat-message-input {
        background-color: #2a2a2a;
        color: #fff;
    }
    
    .chat-toolbar label i {
        color: #aaa;
    }
}

/* ============================================
   EMOJI PICKER STYLES
   ============================================ */

/* Emoji Button */
.emoji-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.emoji-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.emoji-button:active {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Emoji Picker Container */
.emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 16px;
    right: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    max-width: 350px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Emoji Picker Header */
.emoji-picker-header {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background-color: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.emoji-categories {
    display: flex;
    gap: 8px;
    justify-content: space-around;
    align-items: center;
}

.emoji-category {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.emoji-category:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.emoji-category.active {
    background-color: var(--whatsapp-light-green);
    transform: scale(1.15);
}

/* Emoji Picker Body */
.emoji-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 250px;
    max-height: 300px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.emoji-item {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 28px;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

.emoji-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.2);
}

.emoji-item:active {
    transform: scale(1.1);
}

/* Scrollbar for emoji picker */
.emoji-picker-body::-webkit-scrollbar {
    width: 6px;
}

.emoji-picker-body::-webkit-scrollbar-track {
    background: transparent;
}

.emoji-picker-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.emoji-picker-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Mobile adjustments for emoji picker */
@media (max-width: 768px) {
    .emoji-picker {
        left: 8px;
        right: 8px;
        max-width: calc(100% - 16px);
        max-height: 350px;
    }
    
    .emoji-categories {
        gap: 4px;
    }
    
    .emoji-category {
        font-size: 20px;
        padding: 6px;
        min-width: 36px;
        min-height: 36px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
    }
    
    .emoji-item {
        font-size: 24px;
        padding: 6px;
    }
    
    .emoji-picker-body {
        min-height: 200px;
        max-height: 250px;
        padding: 8px;
    }
    
    .emoji-button {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Small mobile phones */
@media (max-width: 375px) {
    .emoji-picker {
        max-height: 300px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }
    
    .emoji-item {
        font-size: 22px;
        padding: 4px;
    }
    
    .emoji-category {
        font-size: 18px;
        padding: 4px;
        min-width: 32px;
        min-height: 32px;
    }
    
    .emoji-picker-body {
        min-height: 180px;
        max-height: 220px;
    }
}

/* Tablet devices */
@media (min-width: 769px) and (max-width: 1024px) {
    .emoji-picker {
        max-width: 380px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(9, 1fr);
    }
}

/* Emoji and voice button styles (if added) */
@media (max-width: 768px) {
    .emoji-button,
    .voice-button {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        border: none;
        background: transparent;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        transition: background-color 0.2s;
    }
    
    .emoji-button:active,
    .voice-button:active {
        background-color: rgba(0, 0, 0, 0.05);
    }
    
    .emoji-button i,
    .voice-button i {
        font-size: 22px;
        color: #667781;
    }
}

/* Mobile input focus styles */
@media (max-width: 768px) {
    .texty_input:focus,
    #chat-message-input:focus {
        box-shadow: none;
        outline: none;
    }
}

/* Prevent input zoom on focus (iOS) */
@media (max-width: 768px) {
    select,
    textarea,
    input[type="text"],
    input[type="email"],
    input[type="tel"] {
        font-size: 16px !important;
    }
}

/* Floating action button for voice message (optional) */
@media (max-width: 768px) {
    .voice-record-fab {
        position: fixed;
        bottom: 80px;
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: var(--whatsapp-green);
        color: #fff;
        border: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        cursor: pointer;
        z-index: 999;
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    .voice-record-fab:active {
        transform: scale(0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .voice-record-fab.recording {
        background: #e74c3c;
        animation: pulse-record 1.5s infinite;
    }
}

@keyframes pulse-record {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(231, 76, 60, 0.5);
    }
    50% {
        box-shadow: 0 4px 20px rgba(231, 76, 60, 0.8);
    }
}

/* Mobile-specific message list padding */
@media (max-width: 768px) {
    .rce-container-mlist {
        padding-bottom: 10px;
    }
    
    /* When reply is active */
    #reply-preview:not(.hidden) ~ .rce-container-mlist {
        padding-bottom: 70px;
    }
}

/* Tablet input adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .rce-container-input {
        padding: 10px 16px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
    
    .texty_input,
    #chat-message-input {
        font-size: 15px;
        padding: 10px 15px;
    }
    
    #chat-message-submit {
        width: 46px;
        height: 46px;
    }
}

/* ============================================
   VOICE INPUT STYLES
   ============================================ */

/* Voice Input Button */
.voice-input-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.voice-input-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.voice-input-btn:active {
    background-color: rgba(0, 0, 0, 0.1);
}

.voice-input-btn i {
    font-size: 24px;
    color: #667781;
}

.voice-input-btn.recording {
    background-color: #ef4444;
    animation: pulse 1.5s infinite;
}

.voice-input-btn.recording i {
    color: #fff;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Voice Recording Indicator */
#voice-recording-indicator {
    background: #f0f2f5;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.voice-recording-content {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 100%;
}

.recording-animation {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.recording-animation i {
    font-size: 20px;
    color: #ef4444;
    z-index: 2;
}

.recording-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    animation: pulseRing 1.5s infinite;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.recording-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.recording-text {
    font-size: 14px;
    font-weight: 600;
    color: #ef4444;
}

.recording-time {
    font-size: 12px;
    color: #667781;
    font-family: monospace;
}

#cancel-recording-btn,
#stop-recording-btn {
    min-width: 80px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

#cancel-recording-btn {
    background: #fff;
    color: #ef4444;
    border: 1px solid #ef4444;
}

#cancel-recording-btn:hover {
    background: #fef2f2;
}

#stop-recording-btn {
    background: var(--whatsapp-green);
    color: #fff;
    border: none;
}

#stop-recording-btn:hover {
    background: #20bd5f;
}

/* Voice message in chat */
.voice-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: inherit;
    border-radius: 8px;
    min-width: 200px;
    max-width: 350px;
}

.voice-message-play-btn {
    background: var(--whatsapp-green);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.voice-message-play-btn:hover {
    background: #20bd5f;
}

.voice-message-play-btn i {
    font-size: 16px;
    color: #fff;
}

.voice-message-waveform {
    flex: 1;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.voice-message-bar {
    width: 3px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    transition: all 0.2s;
}

.voice-message-bar.active {
    background: var(--whatsapp-green);
}

.voice-message-duration {
    font-size: 11px;
    color: #667781;
    font-family: monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .voice-input-btn {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }
    
    .voice-input-btn i {
        font-size: 22px;
    }
    
    #voice-recording-indicator {
        padding: 10px 12px;
    }
    
    .voice-recording-content {
        gap: 10px;
    }
    
    #cancel-recording-btn,
    #stop-recording-btn {
        min-width: 70px;
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .voice-message {
        min-width: 180px;
        max-width: 300px;
    }
}

@media (max-width: 375px) {
    .voice-recording-content {
        gap: 8px;
    }
    
    #cancel-recording-btn,
    #stop-recording-btn {
        min-width: 60px;
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .recording-text {
        font-size: 13px;
    }
    
    .recording-time {
        font-size: 11px;
    }
}
