/* ================================
   MAIN LAYOUT & CHAT STRUCTURE
=================================*/
.flex-col.h-full.bg-\[\#1a1a1a\] {
    position: relative;
}

#pinned-messages-container {
    position: sticky;
    top: 0;
    z-index: 40;
}

.flex-1.overflow-y-auto {
    flex: 1;
    overflow-y: auto;
}

.custom-date-icon {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    position: relative;
    color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5C3.9 4 3 4.9 3 6v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11zM7 11h5v5H7v-5zm7 0h3v3h-3v-3z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
}

.custom-date-icon::-webkit-calendar-picker-indicator {
    opacity: 0;
}

/* ================================
   CHAT DRAWER & MESSAGES
=================================*/
#chat-drawer {
    width: 450px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100px;
    overflow-x: hidden;
    width: 100%;
}

/* ================================
   IMAGE MODAL
=================================*/
#image_modal_3 .modal-box {
    background-color: #1e1b20;
    padding: 1rem;
    max-width: 90%;
    margin: 0 auto;
}

#image_modal_3 .w-full.h-full {
    display: flex;
    justify-content: center;
    align-items: center;
}

#image_modal_3 img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* ================================
   STICKY FOOTER
=================================*/
.sticky.bottom-0 {
    position: fixed;
    bottom: 0;
    width: inherit;
    z-index: 50;
    background-color: #374151;
}

/* ================================
   TEXT & WORD BREAK FIXES
=================================*/
.bg-[#374151], .bg-[#eba030] {
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
    text-align: left;
}

#chat-messages .bg-[#374151],
#chat-messages .bg-[#eba030] {
    word-wrap: break-word;
    word-break: break-all;
    white-space: normal;
}

#chat-messages .max-w-lg {
    width: 100%;
    max-width: 75%;
    overflow-wrap: break-word;
    margin-left: 5px;
    overflow: hidden;
}

#chat-messages .flex.items-start.gap-2.5 {
    width: 100%;
    flex-wrap: wrap;
    padding: 0 5px;
}

#chat-messages p {
    overflow-wrap: break-word;
    word-break: break-all;
    max-width: 100%;
    display: inline-block;
    width: 100%;
}

#chat-messages .flex.flex-col.gap-1 {
    max-width: 100%;
    width: 100%;
}

.notification-drop-down-custom {
    text-align: left;
}

/* Prevent flex shrinking */
#chat-drawer .flex {
    flex-shrink: 0;
}

/* ================================
   RESPONSIVE BEHAVIOR
=================================*/
@media (min-width: 641px) {
    .sticky.bottom-0 {
        width: 450px;
    }
}

@media (max-width: 640px) {
    #chat-drawer {
        width: 100% !important;
    }
    .max-w-lg {
        max-width: 80vw;
    }
    .sticky.bottom-0 {
        width: 100%;
    }
    .notification-drop-down-custom {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
        position: fixed !important;
        top: 60px !important;
        border-radius: 0 0 16px 16px !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        z-index: 9999;
    }
}

/* Notification Dropdown Fixes (Tablets & Laptops) */
@media (max-width: 1024px) {
    .notification-drop-down-custom {
        width: 410px !important;
        max-width: 100% !important;
        left: 30% !important;
        right: 50% !important;
        position: fixed !important;
        top: 70px !important;
        border-radius: 0 0 16px 16px !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        z-index: 9999;
    }
    #header {
        flex-wrap: wrap !important;
        height: auto !important;
    }
    #navbar-logo {
        flex: 1 1 100%;
        justify-content: space-between;
        flex-direction: row;
        margin-bottom: 1rem;
    }
    .flex-no-wrap {
        flex-wrap: wrap !important;
    }
    .hidden.md\:block {
        display: none !important;
    }
    .md\:me-4 {
        margin-right: 0 !important;
    }
}

/* ================================
   LOADER & ANIMATIONS
=================================*/
@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.animate-spin-slow {
    animation: spin-slow 3s linear infinite;
}

#chat-form {
    position: relative;
    overflow: visible;
}

/* ================================
   OTP INPUT FIXES
=================================*/
.otp-input {
    -moz-appearance: textfield;
}

.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ================================
   ROTATION ICON
=================================*/
.rotate {
    width: 80px;
    height: 80px;
    animation: rotation infinite 3s linear;
}

@keyframes rotation {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
