.emojis-main .contact-poll .contact-poll-content {
    left: 0px !important;
}

.chitchat-main .messages .contact-details {
    width: calc(100vw - 120px) !important;
}

.chitchat-main .message-input {
    width: calc(100vw) !important;
}



.chitchat-main .messages .contact-details .left.d-flex .flex-grow-1:before {
    content: "";
    position: absolute;
    right: 0;
    height: 30px;
    width: 0px !important;
    background-color: rgba(34, 54, 69, .5);
    top: 5px;
}

#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    margin-bottom: 20px;
}

#lightbox-overlay .download-btn {
    align-self: center;
}

.chat-img-position {
    width: 100% !important;
}

.chitchat-main .message-input input {
    width: calc(100% - 100px) !important;
}



@media (max-width: 480px) {
    .chitchat-container .chitchat-main .messages .contact-details {
        width: calc(100vw - 35px) !important;
        top: 20px;
    }

}

@media (max-width: 1199.98px) {
    .chitchat-main .messages .contact-details .left.d-flex .flex-grow-1 {
        display: flex !important;
    }
}

@media (max-width: 1024px) {
    .chitchat-main .messages .contact-details .flex-grow-1 h5, .chitchat-main .messages .contact-details .flex-grow-1 .h5 {
        display: flex;
    }

    .bot_username {
        max-width: 100% !important;
        margin-left: 20px !important;
    }
}


.login_footer{        
    position: absolute;
    bottom: 0;
    width: 100%;
    text-align: center;
}

.login_footer a {
    color: #000000;
    text-decoration: none;
    font-weight: bold;
}

/* Links in bot messages - white on blue background */
li.sent ul.msg-box a,
li.sent ul.msg-box a:link,
li.sent ul.msg-box a:visited,
li.sent ul.msg-box a:hover,
li.sent ul.msg-box a:active,
li.sent ul.msg-box a:focus {
    color: #ffffff !important;
    text-decoration: underline;
}

li.sent ul.msg-box a:hover {
    color: #f0f0f0 !important;
}

/* Make text white in p elements that follow li.sent */
li.sent p {
    color: #ffffff !important;
}

/* Also apply to p elements within the message box structure */
li.sent ul.msg-box p {
    color: #ffffff !important;
}

/* Apply to any p element that is a sibling after li.sent */
li.sent + p {
    color: #ffffff !important;
}

/* SweetAlert popup links */
.swal2-html-container a {
    color: #007bff !important;
    text-decoration: underline;
}

.swal2-html-container a:hover {
    color: #0056b3 !important;
}

/* ================================
   RESPONSIVE DESIGN OPTIMIZATIONS
   ================================ */

/* Mobile-First Approach - Enhanced */
@media (max-width: 576px) {
    /* Chat container improvements */
    .chitchat-container {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .chitchat-main .messages .contact-details {
        width: calc(100vw - 20px) !important;
        top: 15px;
        padding: 10px;
    }
    
    .chitchat-main .message-input {
        width: 100% !important;
        padding: 10px;
    }
    
    .chitchat-main .message-input input {
        width: calc(100% - 80px) !important;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
    }
    
    /* Touch-friendly buttons */
    .chitchat-main .message-input .send-btn {
        min-width: 60px !important;
        min-height: 44px !important;
        padding: 10px !important;
    }
    
    /* Mobile navigation */
    .main-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background: #fff;
        transition: left 0.3s ease;
        z-index: 1000;
    }
    
    .main-nav.on {
        left: 0;
    }
    
    /* Mobile overlay */
    .mobile-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    /* Chat messages mobile optimization */
    .messages .message-main {
        padding: 8px 12px;
        margin-bottom: 10px;
    }
    
    .messages .message-main .message-text {
        font-size: 14px;
        line-height: 1.4;
    }
    
    /* Login forms mobile optimization */
    .login-content {
        padding: 20px;
        margin: 0 15px;
    }
    
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
        min-height: 44px;
    }
    
    .btn {
        min-height: 44px;
        font-size: 16px;
    }
}

/* Tablet Portrait */
@media (min-width: 577px) and (max-width: 768px) {
    .chitchat-main .messages .contact-details {
        width: calc(100vw - 60px) !important;
        padding: 15px;
    }
    
    .chitchat-main .message-input input {
        width: calc(100% - 90px) !important;
        font-size: 15px;
    }
    
    .messages .message-main {
        padding: 10px 15px;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    .chitchat-main .messages .contact-details {
        width: calc(100vw - 80px) !important;
    }
    
    .chitchat-main .message-input input {
        width: calc(100% - 95px) !important;
    }
}

/* Desktop optimization */
@media (min-width: 1025px) {
    .chitchat-main .messages .contact-details {
        width: calc(100vw - 120px) !important;
    }
    
    .chitchat-main .message-input input {
        width: calc(100% - 100px) !important;
    }
}

/* Landscape orientation fixes */
@media (orientation: landscape) and (max-height: 500px) {
    .login-page2 .login-content {
        padding: 15px;
    }
    
    .login-content h4 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .chitchat-main .messages .message-main img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .chitchat-main {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    .message-input input {
        background-color: #2d2d2d;
        color: #ffffff;
        border-color: #444;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .main-nav {
        transition: none;
    }
    
    .mobile-overlay {
        transition: none;
    }
}

/* Focus improvements for accessibility */
.chitchat-main .message-input input:focus,
.form-control:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Touch target improvements */
@media (pointer: coarse) {
    .btn, .form-control, .message-input .send-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .messages .message-main {
        padding: 12px 16px;
    }
}

/* Lightbox mobile optimization */
@media (max-width: 576px) {
    #lightbox-overlay img {
        max-width: 95%;
        max-height: 80%;
    }
    
    #lightbox-overlay .download-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Login page background styles */
.login-page2 {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    width: 100%;
    height: 100%;
    position: relative;
}

/* Print styles */
@media print {
    .chitchat-main .message-input,
    .main-nav,
    .mobile-overlay {
        display: none !important;
    }
    
    .messages .message-main {
        page-break-inside: avoid;
    }
}