﻿@media (min-width: 576px) and (max-width: 767px) {
    .row-eaisai {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        min-width: 300px; /* You can adjust this value as needed */
    }

    .col-md-4 {
        flex: 0 0 auto;
        width: 100% !important;
    }
}

/* Responsive Header and Navigation */
@media (max-width: 991.98px) {
    #page-header .row {
        flex-direction: column;
        align-items: flex-start;
        .home-menu > li > a:hover

{
    background: none;
}

}

#page-header .col-sm-6 {
    width: 100%;
    text-align: left;
    margin-bottom: 10px;
}

#header-menu {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
}

#primary-menu ul {
    flex-direction: row;
    width: 50%;
    padding-left: 0;
}


        #primary-menu ul li ul {
            position: static;
            box-shadow: none;
            background: none;
            padding-left: 1rem;
        }

    #primary-menu ul > li.active > a, #primary-menu ul > li:hover > a {
        color: #B5007C;
    }

}

/* Hamburger menu styles */
.header-hamburger {
    display: none;
    color: #B5007C;
    background: none;
    border: none;
    font-size: 2rem;
    position: absolute;
    top: 46px;
    left: 2px;
    z-index: 1001;
}

    .header-hamburger:active, .header-hamburger:focus {
        background: rgba(0,0,0,0.12);
        color: #B5007C;
        outline: none;
    }

@media (max-width: 767.98px) {
    .header-hamburger {
        display: block;
    }

    #primary-menu {
        display: none;
        width: 100%;
        background: rgba(255,255,255,0.92);
        position: absolute;
        top: 60px;
        left: 0;
        z-index: 1000;
        box-shadow: 0 2px 16px rgba(0,0,0,0.13);
        border-radius: 0 0 12px 12px;
        backdrop-filter: blur(4px);
    }

        #primary-menu.active {
            display: block;
        }

        #primary-menu ul {
            flex-direction: column;
            width: 100%;
            padding-left: 0;
            margin: 0;
        }

            #primary-menu ul li {
                width: 100%;
                border-bottom: 1px solid #e0e0e0;
                background: transparent;
            }

                #primary-menu ul li:last-child {
                    border-bottom: none;
                }

                #primary-menu ul li ul {
                    position: static;
                    box-shadow: none;
                    background: rgba(245,245,245,0.95);
                    padding-left: 1rem;
                    margin-top: 4px;
                    border-radius: 0 0 8px 8px;
                    border: 1px solid #e0e0e0;
                    display: none;
                    max-height: 60vh; /* allow scrolling if submenu is tall */
                    overflow-y: auto;
                    width: 100%; /* ensure submenu takes full width */
                    z-index: 1001;
                }

                #primary-menu ul li.active > ul {
                    display: block;
                }

                #primary-menu ul li ul li {
                    border-bottom: none;
                    background: transparent;
                }

                #primary-menu ul li ul {
                    margin-left: 0.5rem;
                }

    .home-menu {
        position: static !important;
        top: auto !important;
        left: 0 !important;
        width: 100% !important;
        background: rgba(255,255,255,0.95) !important;
        z-index: 1002 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

        .home-menu > li, .home-menu > li > a {
            color: #222 !important;
            background: transparent !important;
            text-shadow: none !important;
        }

            .home-menu > li > a:hover {
                background: rgba(0,123,255,0.08) !important;
                color: #B5007C !important;
            }

    .text-info {
        height: 70px !important;
        width: 315px !important;
    }
}

/* Fix for mobile submenu visibility and scrolling */
@media (max-width: 767.98px) {
    #primary-menu ul li ul {
        max-height: 60vh;
        overflow-y: auto;
        width: 100%;
        background: #fff;
        position: relative;
        z-index: 1001;
    }
}

/* Responsive grid container for horizontal scrolling on mobile */
@media (max-width: 768px) {
    .responsive-grid-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    .k-grid {
        min-width: 700px;
        font-size: 14px;
    }

        .k-grid-header th, .k-grid td {
            padding: 8px 6px;
        }
            /* Optionally hide less important columns on mobile */
            .k-grid td:nth-child(n+9),
            .k-grid-header th:nth-child(n+9) {
                display: none;
            }
}

/* General improvements for mobile */
@media (max-width: 480px) {
    .k-grid {
        font-size: 12px;
    }

    h1, h3.title {
        font-size: 1.2em;
    }

    #header-menu a {
        padding: 5px 4px;
    }

        #header-menu a:hover, #header-menu a:focus, #header-menu a:active {
            padding: 5px 5px;
        }
}

@media (max-width: 767px) {
    .inner-content {
        padding: 10px;
    }

    .attendee-reporting-border {
        padding: 5px;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left;
    }

    #linkTable {
        width: 100% !important;
        font-size: 14px;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    h1.title, h5, p {
        font-size: 1.1em;
    }

    .bg-white-card {
        border: 1px solid #B6B6B6 !important;
        background: #ffffff;
        height: auto !important;
    }
}

@media (max-width: 768px) {
    #primary-menu > ul > li.active > ul {
        min-width: unset !important;
        width: 100vw !important;
        left: 0 !important;
        top: 50px !important; /* adjust as needed for mobile header height */
        position: absolute !important;
        box-sizing: border-box !important;
        z-index: 9999 !important;
    }

    #primary-menu > ul > li.active > ul {
        display: block;
        top: 85px;
        min-width: 1150px;
        position: absolute;
        left: 0% !important;
        transform: translateX(-50%);
        box-sizing: border-box;
    }

    #primary-menu ul ul {
        max-width: 100vw !important;
        overflow-x: auto !important;
    }
}


@media (max-width: 767px) {
    .row .row-eaisai.bg-white-card {
        height: 0px !important;
    }
}


@media (max-width: 767px) {
    #primary-menu > ul > li.active > ul {
        top: 50px; /* adjust as needed for your mobile header */
        left: 0 !important;
        right: 0;
        width: 100vw;
        min-width: unset;
        max-width: 100vw;
        transform: none;
        border-radius: 0;
    }
}

@media (max-width: 767.98px) {
    #primary-menu ul li ul {
        position: fixed !important;
        top: 60px !important; /* below header */
        left: 0 !important;
        width: 100vw !important;
        max-height: 60vh !important;
        overflow-y: auto !important;
        background: #fff !important;
        z-index: 2000 !important;
        box-shadow: 0 4px 16px rgba(0,0,0,0.13);
        border-radius: 0 0 12px 12px;
        margin-top: 0 !important;
        padding-left: 0 !important;
    }

    #primary-menu ul li.active > ul {
        display: block !important;
        height: auto;
        position: relative !important;
        top: 0px !important;
        margin-left: 0px !important;
        left: 0% !important;
    }

    #primary-menu ul ul li a {
        display: block !important;
    }

    body {
        overflow-x: clip;
        position: relative;
    }

    .form-group {
        width: 100%;
        overflow: visible;
    }

    /* Ensure form elements fit viewport */
    .form-control {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 767.98px) {
    #programnav-menu {
        display: none !important;
        width: 100%;
        background: rgba(255,255,255,0.92);
        position: absolute;
        top: 60px !important;
        left: 0;
        z-index: 1000;
        box-shadow: 0 2px 16px rgba(0,0,0,0.13);
        border-radius: 0 0 12px 12px;
        padding-bottom: 12px;
        backdrop-filter: blur(4px);
    }

        #programnav-menu.active {
            display: block !important;
        }

        #programnav-menu ul {
            flex-direction: column;
            width: 100%;
            padding-left: 0;
            margin: 0;
        }

            #programnav-menu ul li {
                width: 100%;
                border-bottom: 1px solid #e0e0e0;
                background: transparent;
            }

                #programnav-menu ul li:last-child {
                    border-bottom: none;
                }

                #programnav-menu ul li ul {
                    position: static;
                    box-shadow: none;
                    background: rgba(245,245,245,0.95);
                    margin-top: 4px;
                    border-radius: 0 0 8px 8px;
                    border: 1px solid #e0e0e0;
                    display: none;
                    max-height: 60vh;
                    overflow-y: auto;
                    width: 100%;
                    z-index: 1001;
                }

                #programnav-menu ul li.active > ul {
                    display: block;
                }

                #programnav-menu ul li ul li {
                    border-bottom: none;
                    background: transparent;
                }

        #programnav-menu > ul > li.active > ul {
            top: 0px !important;
            height: auto;
            display: block !important;
            position: relative !important;
        }

        #programnav-menu ul ul {
            max-width: 100vw !important;
            overflow-x: auto !important;
        }
}

/* Remove all previous conflicting #programnav-menu > ul > li.active > ul mobile overrides above this block */

@media (max-width: 767.98px) {
    #programnav-menu ul li.active > ul {
        display: block !important;
        height: auto;
        position: relative !important;
        top: 0px !important;
        margin-left: 0px !important;
        left: 0% !important;
        box-sizing: border-box !important;
        z-index: 9999 !important;
        min-width: unset !important;
        width: 100vw !important;
    }

    #page-content {
        padding: 5px !important;
        margin: 2px !important;
    }
}

/* --- Responsive fix for DropDownList option overflow on mobile --- */
@media (max-width: 767.98px) {
    select.form-control, .form-control {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

        select.form-control option, .form-control option {
            white-space: normal !important;
            word-break: break-word !important;
            overflow-wrap: break-word !important;
            text-overflow: ellipsis !important;
            max-width: 100vw !important;
            font-size: 1em;
        }
}



/* Tablet-specific menu and layout styles */
@media (min-width: 768px) and (max-width: 991.98px) {
    .header-hamburger {
        display: none !important;
    }

    #meeting-page .col-sm-6, #meeting-page .col-sm-4 {
        width: 50% !important;
        padding: 10px 20px !important;
    }

    #primary-menu > ul > li.active > ul {
        display: block;
        top: 85px;
        min-width: 750px;
        position: absolute;
        left: 50% !important;
        transform: translateX(-50%);
        box-sizing: border-box;
    }

    #programnav-menu > ul > li.active > ul {
        display: block;
        top: 85px;
        min-width: 750px !important;
        position: absolute;
        left: 50% !important;
        transform: translateX(-50%);
        box-sizing: border-box;
    }

    #primary-menu > ul > li.active > ul > li {
        flex: 0 1 auto;
        min-width: unset;
        max-width: unset;
        box-sizing: border-box;
        text-align: center;
        word-break: break-word;
    }

        #primary-menu > ul > li.active > ul > li > a {
            word-break: break-word;
            white-space: normal;
            display: block;
        }

    .responsive-grid-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    #page-content {
        color: #636568;
        margin: 110px 15px !important;
    }

    .page-meetings #page-content {
        margin-top: 75px;
        margin-bottom: 0px;
    }

    .bg-white-card p {
        color: #000000;
        font-size: 15px;
    }

    #programnav-menu ul {
        flex-direction: row;
        width: 50%;
        padding-left: 0;
    }

    #home-page {
        margin-bottom: 15px;
        min-height: calc(100vh - 418px);
    }

}