/* =========================================================================
   AUTO COMPATIBLE CSS FOR ALL RESOLUTION SCREENS
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. GLOBAL RESET & FLUID FOUNDATION
   ------------------------------------------------------------------------- */
html,
body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: border-box !important;
}

/* Flexible Media */
img,
picture,
video,
canvas,
svg,
iframe,
object,
embed {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Text Wrapping & Fluidity */
p,
h1,
h2,
h3,
h4,
h5,
h6,
div,
span,
a {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Flexible Form Controls */
input,
select,
textarea,
button {
    max-width: 100%;
    font-family: inherit;
}

/* Flex Container Safety (Prevents blowing out) */
.min-w-0 {
    min-width: 0 !important;
}

/* -------------------------------------------------------------------------
   2. AUTO FLUID TYPOGRAPHY & SCALING (Using Clamp)
   ------------------------------------------------------------------------- */
/* Automatically scales font sizes based on screen width */
:root {
    --text-xs: clamp(0.65rem, 0.6rem + 0.2vw, 0.75rem);
    --text-sm: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-base: clamp(0.875rem, 0.8rem + 0.38vw, 1rem);
    --text-lg: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-xl: clamp(1.125rem, 1rem + 0.63vw, 1.25rem);
    --text-2xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-3xl: clamp(1.5rem, 1.3rem + 1vw, 1.875rem);
}

/* -------------------------------------------------------------------------
   3. AUTO RESPONSIVE GRID & FLEX UTILITIES
   ------------------------------------------------------------------------- */
/* Auto-fitting Grid: Adjusts column count based on available space */
.auto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Responsive Container */
.auto-container {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(1rem, 5vw, 2rem);
    padding-right: clamp(1rem, 5vw, 2rem);
}

.exec-thumb-code {
    font-size: clamp(0.5rem, 0.8vw + 0.1rem, 0.6rem);
    color: var(--grey);
}

@media (max-width: 767px) {

    .show-entries-box,
    #tour-page-size {
        display: none !important;
    }

    .member-table-pagination {
        display: none !important;
    }

    .theme-tab-nav-wrapper {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .theme-tab-nav-wrapper .theme-tab-nav {
        flex-wrap: nowrap;
        width: max-content;
        min-width: max-content;
    }

    .theme-tab-nav-wrapper .theme-tab-nav .nav-link {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .glass-card:has(#tour-members-table) {
        overflow: visible;
        background: transparent;
        box-shadow: none !important;
    }

    .glass-card:has(#tour-members-table)>div:first-child {
        padding: 0rem !important;
        margin-bottom: 1rem;
        border: 0 !important;
        background: transparent !important;
    }

    .member-table-top .search-box input {
        min-height: calc(2.5em + .5rem + calc(var(--bs-border-width) * 2));
    }

    .glass-card:has(#tour-members-table) .search-box {
        width: 100%;
        min-width: 0 !important;
    }

    #tour-members-table {
        overflow: visible !important;
        padding: 0 0.25rem 0.25rem;
    }

    #tour-members-table .mobile-card-table {
        border-collapse: separate;
        border-spacing: 0 0.8rem;
    }

    #tour-members-table .mobile-card-table tbody tr {
        width: 100% !important;
        margin: 0 0 0.85rem !important;
        padding: 1rem 3rem 3.1rem 1rem !important;
        border: 1px solid rgba(15, 23, 42, 0.08) !important;
        border-radius: 10px !important;
        background: #fff !important;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07) !important;
        overflow: hidden;
    }

    #tour-members-table .mobile-card-table tbody tr::after {
        content: "";
        position: absolute;
        left: 1rem;
        right: 1rem;
        bottom: 2.62rem;
        height: 1px;
        background: rgba(15, 23, 42, 0.08);
    }

    #tour-members-table .mobile-card-table tbody tr:hover {
        transform: none !important;
        background: #fbfcff !important;
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1) !important;
    }

    #tour-members-table .mobile-card-table tbody td {
        padding: 0.26rem 0 !important;
        border: 0 !important;
        display: flex !important;
        align-items: center;
        gap: 0.55rem;
        color: #1f2937 !important;
        font-size: 0.82rem;
        line-height: 1.35;
        --bs-table-bg-state: transparent;
    }

    #tour-members-table .mobile-card-table tbody td::before {
        min-width: 4.15rem;
        margin-right: 0 !important;
        color: #64748b;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0;
        opacity: 1;
    }

    #tour-members-table .mobile-card-table tbody td:nth-child(4),
    #tour-members-table .mobile-card-table tbody td:nth-child(6) {
        display: none !important;
    }

    #tour-members-table .mobile-card-table tbody td:first-child {
        margin: 0 0 0.15rem !important;
        padding: 0 2.1rem 0.1rem 0 !important;
        border-bottom: 0 !important;
        color: var(--primary, #16106a) !important;
        font-size: 0.7rem !important;
        font-weight: 800;
    }

    #tour-members-table .mobile-card-table tbody td:first-child a {
        display: inline-flex;
        align-items: center;
        min-height: auto;
        padding: 0;
        border-radius: 0;
        background: transparent;
        color: var(--primary, #16106a) !important;
        text-decoration: none;
        max-width: calc(100% - 3rem);
        box-shadow: none;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }

    #tour-members-table .mobile-card-table tbody td:first-child a::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
    }

    #tour-members-table .mobile-card-table tbody td:nth-child(2) {
        padding-top: 0 !important;
        padding-bottom: 0rem !important;
        color: #0f172a !important;
        font-size: 1.05rem;
        font-weight: 800;
        border-bottom: 0 !important;
    }

    #tour-members-table .mobile-card-table tbody td:nth-child(2)::before {
        display: none;
    }

    #tour-members-table .mobile-card-table tbody td:nth-child(3) {
        display: inline-flex !important;
        gap: 0.25rem;
        width: auto;
        max-width: calc(100% - 7.25rem);
        position: absolute;
        left: 1rem;
        bottom: 0.92rem;
        margin: 0;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0;
        background: transparent;
        color: #475569 !important;
        font-size: 0.8rem;
        font-weight: 700;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #tour-members-table .mobile-card-table tbody td:nth-child(5) {
        display: inline-flex !important;
        gap: 0.25rem;
        width: auto;
        max-width: 100%;
        margin-top: 0rem;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0;
        background: transparent;
        color: #64748b !important;
        font-weight: 500;
        font-size: 0.86rem;
        float: inline-end;
        margin-right: -30px;
    }

    #tour-members-table .mobile-card-table tbody td:nth-child(3)::before {
        content: "\EF14";
        width: auto;
        height: auto;
        min-width: 0;
        margin-right: 0rem !important;
        border-radius: 0;
        background: transparent;
        color: var(--primary, #16106a);
        font-family: "remixicon";
        font-size: 0.88rem;
        font-weight: 400;
        line-height: 1;
        opacity: 0.8;
    }

    #tour-members-table .mobile-card-table tbody td:nth-child(5)::before {
        content: "\EFEC";
        width: auto;
        height: auto;
        min-width: 0;
        margin-right: 0rem !important;
        color: #94a3b8;
        font-family: "remixicon";
        font-size: 0.86rem;
        font-weight: 400;
        line-height: 1;
        opacity: 1;
    }

    #tour-members-table .mobile-card-table tbody td:nth-child(7) {
        position: absolute;
        right: 1rem;
        bottom: 0.74rem;
        width: auto;
        margin-top: 0;
        padding: 0 !important;
    }

    #tour-members-table .mobile-card-table tbody td:nth-child(7) .badge {
        padding: 0.34rem 0.62rem !important;
        font-size: 0.68rem;
        font-weight: 700;
        box-shadow: none !important;
    }

    #tour-members-table .mobile-card-table tbody td:nth-child(7)::before {
        display: none;
    }

    #tour-members-table .mobile-card-table tbody td:last-child {
        position: absolute;
        top: 0.72rem;
        right: 0.72rem;
        width: auto !important;
        padding: 0 !important;
        z-index: 2;
    }

    #tour-members-table .mobile-card-table tbody td:last-child::before {
        display: none;
    }

    #tour-members-table .mobile-card-table tbody td:last-child .btn {
        width: 1.9rem;
        height: 1.9rem;
        border-radius: 8px;
        background: rgba(15, 23, 42, 0.04);
        color: var(--primary, #16106a) !important;
    }

    .glass-card:has(#tour-members-table)>div:last-child {
        margin-top: 0.4rem;
        padding: 0.85rem !important;
        border: 0 !important;
        border-radius: 12px;
        background: rgb(255 255 255 / 34%) !important;
    }

    .dropdown-menu.show {
        padding: 4px;
        margin-right: 30px !important;
        margin-top: -30px !important;
        scale: none;
    }

    .dropdown-menu .dropdown-item {
        font-size: clamp(0.75rem, 0.8vw + 0.35rem, 0.83rem) !important;
        padding: 4px 12px;
    }

    .dropdown-menu .dropdown-item i {
        font-size: clamp(0.75rem, 0.8vw + 0.35rem, 0.83rem);
        width: auto;
    }

}

@media (max-width: 360px) {
    .otp-boxes {
        gap: 6px;
    }

    .otp-box {
        width: 33px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 10px;
    }
}

@media (max-width: 374px) {
    .data-card-wrap h5#displayAadharName {
        font-size: clamp(0.71rem, 2vw + 0.15rem, 1.55rem);
    }
}

/* -------------------------------------------------------------------------
   4. STANDARD SCREEN RESOLUTION BREAKPOINTS (Media Queries)
   ------------------------------------------------------------------------- */

/* Mobile Devices (Portrait & Landscape) - Up to 575px */

@media (max-width: 575.98px) {
    .hide-on-mobile {
        display: none !important;
    }

    .w-100-mobile {
        width: 100% !important;
    }
}

/* Small Tablets and Large Smartphones - 576px to 767px */
@media (min-width: 576px) and (max-width: 767.98px) {

    /* Styles for landscape phones & small tablets */
    .auto-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .w-sm-100 {
        width: 100% !important;
    }

    /* Force tables to be scrollable if not already */
    table:not(.mobile-card-table) {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Tablets (Portrait & Landscape) - 768px to 991px */
@media (min-width: 768px) and (max-width: 991.98px) {

    /* Styles for typical tablets like iPad */
    .auto-container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .w-md-100 {
        width: 100% !important;
    }

    .w-md-auto {
        width: auto !important;
    }

    /* Ensure flex layouts don't break */
    .flex-md-wrap {
        flex-wrap: wrap !important;
    }
}

/* Laptops and Small Desktops - 992px to 1199px */
@media (min-width: 992px) and (max-width: 1199.98px) {

    /* Styles for laptops */
    .w-lg-50 {
        width: 50% !important;
    }

    .w-lg-75 {
        width: 75% !important;
    }

    .w-lg-100 {
        width: 100% !important;
    }

    /* Improve flex layouts on medium screens */
    .flex-lg-row {
        flex-direction: row !important;
    }
}

/* Large Desktops and High-Res Screens - 1200px to 1399px */
@media (min-width: 1200px) and (max-width: 1399.98px) {

    /* Styles for standard desktops */
    .w-xl-50 {
        width: 50% !important;
    }

    .w-xl-75 {
        width: 75% !important;
    }
}

/* -------------------------------------------------------------------------
   5. SPECIAL RESOLUTION FIXES
   ------------------------------------------------------------------------- */
/* Fix for High DPI (Retina) Displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    /* High-res specific adjustments */
    img {
        /* Optimize image rendering on retina displays */
        image-rendering: -webkit-optimize-contrast;
    }

    /* Ensure fine borders are crisp */
    .border-crisp {
        border-width: 0.5px !important;
    }
}

/* Fix for Orientation (Mobile Landscape) */
@media (orientation: landscape) and (max-height: 500px) {

    /* Prevent elements from being cut off vertically */
    .modal-dialog {
        margin: 0.5rem auto;
    }

    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
    }

    /* Unstick header to save vertical space */
    .top-header,
    .sticky-top {
        position: relative !important;
        top: 0 !important;
        z-index: 1;
    }

    body {
        height: auto;
        min-height: 100vh;
    }
}