﻿.dropdown-menu {
    max-height: 200px !important;
    overflow-y: scroll !important;
}

/* ============================================
   CHAT VIEW RESPONSIVE FIXES
   ============================================ */

/* Fix height-chat to be more responsive to zoom and viewport changes */
.height-chat {
    height: calc(100vh - 170px);
    height: calc(100dvh - 170px); /* Use dynamic viewport height for mobile browsers */
    min-height: 400px;
    max-height: none;
}

/* Tablet adjustments */
@media (max-width: 991.98px) {
    .height-chat {
        height: calc(100vh - 150px);
        height: calc(100dvh - 150px);
        min-height: 350px;
    }
}

/* Mobile adjustments */
@media (max-width: 767.98px) {
    .height-chat {
        height: calc(100vh - 130px);
        height: calc(100dvh - 130px);
        min-height: 300px;
    }
}

/* Fix max-h-497 to use viewport-relative units */
.max-h-497 {
    max-height: min(497px, calc(100vh - 350px)) !important;
    max-height: min(497px, calc(100dvh - 350px)) !important;
}

@media (max-width: 991.98px) {
    .max-h-497 {
        max-height: min(400px, calc(100vh - 300px)) !important;
        max-height: min(400px, calc(100dvh - 300px)) !important;
    }
}

@media (max-width: 767.98px) {
    .max-h-497 {
        max-height: calc(100vh - 280px) !important;
        max-height: calc(100dvh - 280px) !important;
    }
}

/* Conversation card responsive - full width on mobile when visible */
#conversationCard {
    transition: all 0.3s ease;
}

@media (max-width: 767.98px) {
    #conversationCard {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* When conversation is open on mobile, hide leads list */
    #leadsCard.chat-mobile-hidden {
        display: none !important;
    }
}

/* Fix overflow issues with zoom */
#leadsCard .card,
#conversationCard .card {
    overflow: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Messages area responsive height */
.height-mensajes {
    height: calc(100vh - 470px) !important;
    height: calc(100dvh - 470px) !important;
    min-height: 150px;
}

@media (max-width: 991.98px) {
    .height-mensajes {
        height: calc(100vh - 400px) !important;
        height: calc(100dvh - 400px) !important;
    }
}

@media (max-width: 767.98px) {
    .height-mensajes {
        height: calc(100vh - 350px) !important;
        height: calc(100dvh - 350px) !important;
        min-height: 200px;
    }
}

/* Prevent content overflow on zoom */
.card-body {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Chat tabs responsive */
@media (max-width: 575.98px) {
    .chat-tabs .nav-link {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }

    .chat-tabs .nav-item {
        flex: 1;
        text-align: center;
    }
}

/* ============================================
   DEGREE ACCORDION CARD STYLING
   ============================================ */
#accordionDegreeView .accordion-button:not(.collapsed),
#accordionDegreeApproval .accordion-button:not(.collapsed) {
    background-color: #fff;
    color: inherit;
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important;
}

#accordionDegreeView .accordion-button:focus,
#accordionDegreeApproval .accordion-button:focus {
    box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important;
    border-color: transparent;
}
