/* ===================================
   IPN Website - Media Queries
   Responsive styles for all breakpoints
   =================================== */


/* ===================================
 IPN Logo Responsiveness 
   =================================== */
/* Medium/Large Phones (360px - 499px) */
@media (min-width: 360px) and (max-width: 499px)
{
    .ipn-logo {
        height: 55px;
        width: auto;
    }

    .ipn-brand-text {
        font-size: 18px !important;
        line-height: 1.2 !important;
    }

    .navbar-brand {
        gap: 0.35rem !important;
    }

    /* Shrink to 0.8 on scroll with left shift */
    .sticky-header.scrolled .ipn-logo {
        transform: scale(0.8) !important;
    }

    .sticky-header.scrolled .ipn-brand-text {
        transform: scale(0.8) translateX(-0.8rem) !important;
    }
}

/* Smallest Phones (300px - 359px) */
@media (min-width: 300px) and (max-width: 359px)
{
    .ipn-logo {
        height: 50px;
        width: auto;
    }

    .ipn-brand-text {
        font-size: 14px !important;
        line-height: 1.2 !important;
    }

    .navbar-brand {
        gap: 0.25rem !important;
    }

    /* Shrink to 0.4 on scroll with left shift */
    .sticky-header.scrolled .ipn-logo {
        transform: scale(0.8) !important;
    }

    .sticky-header.scrolled .ipn-brand-text {
        transform: scale(1.0) translateX(-0.8rem) !important;
    }
}

@media (min-width: 500px) and (max-width: 1024px) {
    .ipn-logo {
        height: 80px;
        width: auto;
    }

    .ipn-brand-text {
        font-size: 32px !important;
        line-height: 1.3 !important;
    }

    .navbar-brand {
        gap: 0.35rem !important;
    }

    /* Tablet shrink with left shift */
    .sticky-header.scrolled .ipn-brand-text {
        transform: scale(0.6) translateX(-2.6rem) !important;
    }

}

@media (min-width: 1025px) {
    .ipn-logo {
        height: 100px;
        width: auto;
    }

    /* Desktop shrink with left shift */
    .sticky-header.scrolled .ipn-brand-text {
        transform: scale(0.6) translateX(-3rem) !important;
    }

}

@media (min-width: 1440px) and (max-width: 4000px) {
    .ipn-logo {
        height: 120px;
        width: auto;
    }

}

/* ===================================
   Large Desktop (min-width: 1400px)
   Half the container side padding of laptop screens
   =================================== */

@media (min-width: 1400px) {
    .container {
        max-width: 90vw !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    /* Exclude .hero and .quote-section so they stay flush with no gap. */
    section:not(.hero):not(.quote-section) {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    /* Quote section gets a modest padding on large desktop */
    .quote-section {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
        margin-top: 0 !important;
    }
}


    /* ===================================
   Mobile Page Banner
   =================================== */

    .mobile-page-banner {
        background: linear-gradient(90deg, var(--ipn-accent) 0%, var(--ipn-primary-shade) 100%);
        padding: 30px 0;
        display: none; /* Hidden by default, shown on mobile via media query */
    }

    .mobile-page-title {
        color: rgba(255, 255, 255, 0.95);
        font-size: 28px;
        font-weight: bold;
        margin: 0;
        text-align: center;
        letter-spacing: 0.5px;
    }

    /* ===================================
   Tablet Hero Image Container
   =================================== */

    .tablet-hero-image {
        display: none; /* Hidden by default, shown only on tablet via media query */
        width: 100%;
        overflow: hidden;
    }

        .tablet-hero-image img {
            width: 100%;
            height: auto;
            display: block;
            object-fit: contain;
        }


    /* ===================================
   Mobile (max-width: 499px)
   =================================== */

    @media (max-width: 499px) {
        .hero {
            min-height: 380px !important;
            height: 380px !important;
        }

        /* Hide secondary bar on mobile (its links live in the hamburger menu) */
        .secondary-bar {
            display: none;
        }

        /* Hide top bar on mobile — it sits above .sticky-header in the DOM
           and pushes the navbar down the page on small screens */
        /*.top-bar {
            display: none;
        }*/

        /* Top bar — visible on mobile, fully centred stacked layout */
        .top-bar .row {
            flex-direction: column;
            align-items: center !important;
            gap: 0.25rem;
        }

        /* Both columns full-width and centred */
        .top-bar .col-lg-6 {
            width: 100%;
            display: flex;
            justify-content: center;
        }

        /* The flex wrapper that holds the company name */
        .top-bar .col-lg-6 > .d-flex {
            justify-content: center;
        }

        /* Company name text */
        .company-name {
            font-size: 1rem;
            justify-content: center;
            text-align: center;
        }

        /* Social icons row — override the lg-only end-alignment */
        .top-bar__social {
            justify-content: center !important;
        }

        /* Buttons — smaller on mobile */
        .btn-gradient {
            padding: 8px 20px !important;
            font-size: 0.875rem !important;
        }

        .btn-gradient svg {
            width: 16px !important;
            height: 16px !important;
        }

        .auth-link {
            font-size: 0.875rem !important;
        }

        .login-btn {
            font-size: 0.875rem !important;
            padding: 8px 16px !important;
        }

        /* Timeline cards — left align content on mobile */
        .timeline-card .timeline-title,
        .timeline-card .timeline-subtitle,
        .timeline-card .timeline-meta {
            text-align: left !important;
        }

        /* Feature cards (Innovation section) — left align content on mobile */
        .feature-card .feature-title,
        .feature-card .feature-description {
            text-align: left !important;
        }

        /* News cards — left align content on mobile */
        .news-card .news-date,
        .news-card .card-title,
        .news-card .card-text,
        .news-card .read-more-link {
            text-align: left !important;
        }

        /* Quote section on mobile */
        .quote-section {
            padding-top: 2rem !important;
            padding-bottom: 2rem !important;
            margin-top: 0 !important;
        }

        .quote-icon {
            font-size: 40px;
        }

        .quote-text p {
            font-size: 1rem !important;
        }

        .quote-text cite {
            font-size: 0.85rem !important;
        }

        /* Mobile spacing adjustments – more padding for breathing room
           Exclude .hero and .quote-section so the carousel-to-quote gap cannot
           be introduced by this rule. */
        section:not(.hero):not(.quote-section) {
            padding-top: 4rem;
            padding-bottom: 4rem;
        }

        .container {
            padding-left: 1.5rem !important;
            padding-right: 1.5rem !important;
        }

        /* Smaller display headings on mobile */
        .display-5 {
            font-size: 2rem;
        }

        /* Section titles stay reduced on mobile */
        .section-title {
            font-size: 1.35rem;
        }

        /* Hero title reduced on mobile now that heroes are visible */
        .hero-title {
            font-size: 24px !important;
            line-height: 1.3;
        }

        .hero-subtitle {
            font-size: 11px !important;
        }

        .hero-description {
            font-size: 14px !important;
        }

        /* Full width buttons on mobile */
        .btn-lg {
            width: 100%;
            max-width: 300px;
        }

        /* Center hero section content on mobile only */
        .hero .hero-content .hero-title,
        .hero .hero-content .hero-subtitle,
        .hero .hero-content .hero-description {
            text-align: center !important;
        }

        .hero .hero-content .btn {
            display: block !important;
            margin-left: auto !important;
            margin-right: auto !important;
            font-size: 0.8rem !important;
            padding: 0.4rem 1rem !important;
            width: auto !important;
            max-width: fit-content !important;
        }

        /* ===================================
       Center ALL Titles and Buttons on Mobile
       =================================== */

        /* Center all headings */
        h1, h2, h3, h4, h5, h6,
        .section-title,
        .section-subtitle,
        .hero-title,
        .hero-subtitle,
        .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
            text-align: center !important;
        }

        /* Center all buttons */
        .btn,
        button,
        a.btn {
            display: block !important;
            margin-left: auto !important;
            margin-right: auto !important;
            text-align: center !important;
        }

        /* Keep inline buttons from breaking */
        .btn-group .btn,
        .d-inline .btn,
        .d-inline-block .btn {
            display: inline-block !important;
        }

        /* EXCEPTION: Keep navbar toggler (hamburger) on the right */
        .navbar-toggler {
            display: inline-block !important;
            margin-left: auto !important;
            margin-right: 0 !important;
        }

        /* Ensure navbar container uses flexbox properly on mobile */
        .navbar .container {
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
            flex-wrap: wrap !important;
        }

        /* Back to top button — positioning fully handled by .btn-back-to-top
           in site.css. No overrides needed here. */

        /* Keep bullets and list items LEFT-aligned (DO NOT center) */
        ul, ol,
        ul li, ol li,
        .list-unstyled,
        .list-unstyled li {
            text-align: left !important;
        }

        /* Keep list content aligned properly */
        li p,
        li span,
        li div {
            text-align: left !important;
        }

        /* ===================================
       Mobile YouTube Video Section
       =================================== */

        /* Always show YouTube overlay on mobile */
        .youtube-overlay {
            transform: translateY(0) !important;
            animation: mobileYoutubePulse 3s ease-in-out infinite;
        }

            /* Add tap instruction text on mobile */
            .youtube-overlay::after {
                content: "Tap to watch";
                font-size: 12px;
                font-weight: 500;
                margin-left: 8px;
                opacity: 0.95;
            }

        /* Larger play button on mobile */
        .about-play-button {
            width: 90px !important;
            height: 90px !important;
            animation: playButtonPulse 2.5s ease-in-out infinite;
        }

            .about-play-button i {
                font-size: 40px !important;
            }

        /* Add subtle border animation to video container */
        .about-ipn {
            position: relative;
            display: block !important;
            min-height: 220px;
        }

            .about-ipn::before {
                content: '';
                position: absolute;
                top: -3px;
                left: -3px;
                right: -3px;
                bottom: -3px;
                background: linear-gradient(45deg, var(--ipn-accent), var(--ipn-primary-shade), var(--ipn-accent));
                border-radius: inherit;
                z-index: -1;
                opacity: 0.6;
                animation: borderGlow 3s ease-in-out infinite;
            }

        .about-ipn iframe {
            display: block !important;
            width: 100%;
            height: 100%;
            min-height: 220px;
        }

        @keyframes mobileYoutubePulse {
            0%, 100% {
                opacity: 1;
            }

            50% {
                opacity: 0.85;
            }
        }

        @keyframes playButtonPulse {
            0%, 100% {
                transform: translate(-50%, -50%) scale(1);
                box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            }

            50% {
                transform: translate(-50%, -50%) scale(1.05);
                box-shadow: 0 6px 25px rgba(var(--ipn-primary-rgb), 0.6);
            }
        }

        @keyframes borderGlow {
            0%, 100% {
                opacity: 0.3;
            }

            50% {
                opacity: 0.6;
            }
        }

        /* ===================================
       Mobile Card Centering
       =================================== */

        /* Center all headings inside cards */
        .card h1,
        .card h2,
        .card h3,
        .card h4,
        .card h5,
        .card h6,
        .card .card-title {
            text-align: center !important;
        }

        /* Center all icons inside cards */
        .card .feature-icon,
        .card .innovation-icon,
        .card i[class*="bi-"],
        .card .bi {
            display: flex !important;
            justify-content: center !important;
            margin-left: auto !important;
            margin-right: auto !important;
        }

        /* Center feature icon containers */
        .feature-icon {
            text-align: center !important;
            justify-content: center !important;
        }

        /* Center innovation card icons */
        .innovation-card .feature-icon,
        .feature-card .feature-icon {
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
        }

        /* Center timeline card content */
        .timeline-card h5,
        .timeline-card .card-title {
            text-align: center !important;
        }

        /* Center About Us timeline titles and content on mobile */
        .timeline-scroll-title,
        .timeline-card-content h3 {
            text-align: center !important;
        }

        .timeline-scroll-date {
            display: block !important;
            text-align: center !important;
            margin-left: auto !important;
            margin-right: auto !important;
        }

        .timeline-scroll-description {
            text-align: center !important;
        }

        /* Center any buttons in timeline cards */
        .timeline-card-content .btn,
        .timeline-scroll-card .btn {
            display: block !important;
            margin-left: auto !important;
            margin-right: auto !important;
            text-align: center !important;
        }

        /* Disable timeline pop-in animations on mobile - show all cards immediately */
        .timeline-scroll-card,
        .timeline-logo-card {
            opacity: 1 !important;
            transform: translateY(0) scale(1) !important;
            transition: none !important;
        }

            .timeline-scroll-card.in-view,
            .timeline-logo-card.in-view {
                opacity: 1 !important;
                transform: translateY(0) scale(1) !important;
            }

        /* ===================================
       Mobile Page Banner
       =================================== */

        /* Show mobile page banner only on mobile */
        /* TEMPORARILY COMMENTED OUT — heroes now show on mobile instead */
        /*
        .mobile-page-banner {
            display: block !important;
        }
        */

        /* Adjust font size for smaller screens */
        .mobile-page-title {
            font-size: 24px !important;
        }

        /* ===================================
       Mobile Contact Page Introduction
       =================================== */

        /* Center contact intro on mobile */
        .container .text-center.text-lg-start,
        .container .text-lg-start {
            text-align: center !important;
        }

            .container .text-lg-start .section-title,
            .container .text-lg-start .section-subtitle,
            .container .text-lg-start p {
                text-align: center !important;
                margin-left: auto !important;
                margin-right: auto !important;
            }

        /* ===================================
       Mobile Contact Details Alignment
       =================================== */

        /* Contact details - center the card but keep icon alignment */
        .col-md-6 .d-flex.gap-3.align-items-start {
            align-items: center !important;
            flex-direction: column !important;
            text-align: center !important;
        }

        /* Keep icon at proper size */
        .col-md-6 .d-flex.gap-3 .bi {
            flex-shrink: 0 !important;
            margin-bottom: 0.5rem !important;
        }

        /* Center all contact detail content */
        .col-md-6 .d-flex.gap-3 div {
            text-align: center !important;
        }

        /* ===================================
       Mobile Side Panel Menu
       =================================== */

        /* Prevent body scroll when menu is open */
        body.overflow-hidden {
            overflow: hidden;
        }

        /* Side panel sliding menu - Sticky and Full Height */
        .navbar-collapse {
            position: fixed !important;
            top: 0 !important;
            bottom: 0 !important;
            left: -100% !important;
            width: 80% !important;
            max-width: 320px !important;
            height: 100% !important;
            min-height: 100vh !important;
            background: #ffffff !important;
            z-index: 200 !important;
            transition: left 0.3s ease-in-out !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
            padding: 20px 20px 80px 20px !important;  /* Extra bottom padding for scrolling */
            -webkit-overflow-scrolling: touch !important;
        }

            .navbar-collapse.show {
                left: 0 !important;
                background: #ffffff !important;
            }

            /* Ensure collapsing state also has white background */
            .navbar-collapse.collapsing {
                background: #ffffff !important;
                left: -100% !important;
            }

        /* Dark overlay behind the panel - Full coverage */
        body::after {
            content: '';
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            min-height: 100vh;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 100;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease-in-out;
        }

        body.menu-open::after {
            opacity: 1;
            pointer-events: auto;
        }

        /* Prevent body scroll when menu is open */
        body.menu-open {
            overflow: hidden !important;
            position: fixed !important;
            width: 100% !important;
            height: 100% !important;
        }

        /* Reset navbar styles for side panel */
        .navbar-nav {
            flex-direction: column !important;
            width: 100% !important;
            margin: 0 !important;
            padding-top: 60px !important;
            padding-bottom: 100px !important;  /* Extra space to ensure account section is scrollable */
            background: #ffffff !important;
            gap: 0 !important;  /* Remove gap-4 from desktop */
        }

        .nav-item {
            width: 100% !important;
            border-bottom: 1px solid #d0d0d0 !important;
            background: #ffffff !important;
            margin: 0 !important;  /* Remove any Bootstrap default margin */
            padding: 0 !important;  /* Remove any nav-item padding */
        }

        .nav-link {
            padding: 15px 10px !important;
            color: var(--ipn-secondary) !important;
            font-weight: 600 !important;
            font-size: 16px !important;
            background-color: transparent !important;
            margin: 0 !important;  /* Remove any Bootstrap default margin */
            display: block !important;
            line-height: 1.5 !important;
        }

            .nav-link:hover,
            .nav-link:active {
                color: #7c3794 !important;
                background-color: #f9f9f9 !important;
            }

        /* ===================================
       Mobile Dropdown Menus
       =================================== */

        /* Dropdown menus push content down (no overlay) */
        .dropdown-menu {
            position: static !important;
            float: none !important;
            width: 100% !important;
            margin: 0 !important;
            border: none !important;
            box-shadow: none !important;
            background: #fafafa !important;
            padding: 0 !important;
            display: none;
        }

            .dropdown-menu.show {
                display: block !important;
                background: #fafafa !important;
            }

        .dropdown-item {
            padding: 12px 10px 12px 25px !important;
            color: #666666 !important;
            font-size: 14px !important;
            background: transparent !important;
        }

            .dropdown-item:hover,
            .dropdown-item:active,
            .dropdown-item:focus {
                color: var(--ipn-primary) !important;
                background: #ffffff !important;
            }

        /* Submenu indentation */
        .dropdown-submenu-menu {
            position: static !important;
            padding-left: 0 !important;
            background: #f5f5f5 !important;
            display: none;
        }

            .dropdown-submenu-menu.show {
                display: block !important;
                background: #f5f5f5 !important;
            }

            .dropdown-submenu-menu .dropdown-item {
                padding-left: 45px !important;
                font-size: 13px !important;
                color: #777777 !important;
                background: transparent !important;
            }

                .dropdown-submenu-menu .dropdown-item:hover,
                .dropdown-submenu-menu .dropdown-item:focus {
                    color: var(--ipn-primary) !important;
                    background: #ffffff !important;
                }

        /* Dropdown toggle icons */
        .dropdown-toggle::after {
            float: right !important;
            margin-top: 8px !important;
        }

        /* Auth buttons are now nav-items inside the list on mobile —
           no special .d-flex overrides needed here */

        /* ===================================
       Stakeholders/Partners - Full Color on Mobile
       =================================== */

        /* Remove grayscale filter - show full color */
        .grayscale-hover {
            filter: none !important;
            opacity: 1 !important;
        }

        /* ===================================
       FAQ Accordion - Mobile Caret Alignment
       =================================== */

        /* Fix accordion button layout for mobile */
        .faq-accordion .accordion-button {
            display: flex !important;
            justify-content: space-between !important;
            align-items: center !important;
            padding: 15px 20px !important;
            font-size: 16px !important;
            text-align: left !important;
            white-space: normal !important;
            word-wrap: break-word !important;
        }

            /* Ensure caret stays aligned to the right on mobile */
            .faq-accordion .accordion-button::after {
                flex-shrink: 0 !important;
                margin-left: 15px !important;
                align-self: flex-start !important;
                margin-top: 2px !important;
            }

        /* Reduce FAQ section container padding on mobile */
        .faq-section-container {
            padding: 20px 15px !important;
            border-radius: 20px !important;
        }

        /* Adjust FAQ body padding on mobile */
        .faq-accordion .accordion-body {
            padding: 1rem 20px 20px 20px !important;
            font-size: 14px !important;
            line-height: 22px !important;
        }

        /* ===================================
       Mobile News Cards (phones)
       =================================== */
        .news-card {
            border-radius: 22px !important;
            overflow: hidden !important;
        }

        .news-card .card-body {
            padding: 1.25rem 1.5rem 1.35rem 1.5rem !important;
        }

        .news-card .news-date {
            display: flex !important;
            justify-content: flex-start !important;
            align-items: center !important;
            gap: 0.5rem !important;
            margin-bottom: 0.85rem !important;
            font-size: 0.9rem !important;
            line-height: 1.2 !important;
            width: auto !important;
            max-width: fit-content !important;
        }

        /* Force date elements to stay together */
        .news-card .news-date i,
        .news-card .news-date time {
            flex-shrink: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }

        .news-card .card-title {
            text-align: left !important;
            font-size: 1.08rem !important;
            line-height: 1.3 !important;
            margin-bottom: 0.8rem !important;
            -webkit-line-clamp: 2 !important;
        }

        .news-card .card-text {
            text-align: left !important;
            font-size: 1.02rem !important;
            line-height: 1.65 !important;
            margin-bottom: 0.9rem !important;
        }

        .news-card .read-more-link {
            text-align: left !important;
            font-size: 1rem !important;
            font-weight: 700 !important;
            margin-top: 0.2rem !important;
        }
    }

    /* ===================================
   Tablet (500px - 1023px)
   =================================== */

    @media (min-width: 500px) and (max-width: 1023px) {
        /* Hide secondary bar on tablet (its links live in the hamburger menu) */
        .secondary-bar {
            display: none;
        }

        /* Hide top bar on tablet — same reason as mobile: sits above sticky-header
           and pushes the navbar down. Hamburger menu is still active at this range. */
        /*.top-bar {
            display: none;
        }*/

        /* More padding on tablet
           Exclude .hero and .quote-section so they stay flush with no gap. */
        section:not(.hero):not(.quote-section) {
            padding-top: 4rem;
            padding-bottom: 4rem;
        }

        .container {
            padding-left: 2rem !important;
            padding-right: 2rem !important;
        }

        /* Top bar: keep contact left, social icons right (no stacking) */
        .top-bar .row {
            flex-wrap: nowrap;
        }

            .top-bar .row > div.col-lg-6 {
                flex: 0 0 auto;
                width: auto;
                max-width: none;
            }

                .top-bar .row > div.col-lg-6:first-child {
                    flex: 1 1 auto;
                }

                .top-bar .row > div.col-lg-6:last-child {
                    flex: 0 0 auto;
                    margin-left: auto;
                }

        .top-bar__social {
            justify-content: flex-end !important;
        }

        /* ===================================
       Tablet Hero - Image Only Display
       =================================== */

        .hero {
            min-height: 460px !important;
            height: 460px !important;
        }

        /* Quote section adjustments */
        .quote-section {
            padding-top: 2.5rem !important;
            padding-bottom: 2.5rem !important;
            margin-top: 0 !important;
        }

        .quote-icon {
            font-size: 60px;
        }

        /* Timeline adjustments (About Us page) */
        .timeline-scroll-card {
            width: 320px;
        }

        .timeline-card-content {
            height: 220px;
            padding: 25px;
        }

        .timeline-connector {
            height: 50px;
        }

        .timeline-horizontal-line {
            bottom: 50px;
            height: 3px;
        }

        .timeline-logo-card {
            width: 320px;
        }

        .timeline-logo-inner {
            width: 220px;
            height: 220px;
            padding: 25px;
        }

        /* Stakeholders/Partners - Full Color on Tablet */
        .grayscale-hover {
            filter: none !important;
            opacity: 1 !important;
        }

        /* ===================================
       Tablet YouTube Video Section
       =================================== */

        /* Always show YouTube overlay on tablet */
        .youtube-overlay {
            transform: translateY(0) !important;
            animation: tabletYoutubePulse 3.5s ease-in-out infinite;
        }

            /* Add tap instruction text on tablet */
            .youtube-overlay::after {
                content: "Tap to watch on YouTube";
                font-size: 13px;
                font-weight: 500;
                margin-left: 10px;
                opacity: 0.95;
            }

        /* Larger play button on tablet */
        .about-play-button {
            width: 85px !important;
            height: 85px !important;
            animation: tabletPlayButtonPulse 3s ease-in-out infinite;
        }

            .about-play-button i {
                font-size: 38px !important;
            }

        /* Subtle glow effect on video container */
        .about-ipn {
            position: relative;
            display: block !important;
            min-height: 260px;
        }

            .about-ipn::before {
                content: '';
                position: absolute;
                top: -2px;
                left: -2px;
                right: -2px;
                bottom: -2px;
                background: linear-gradient(45deg, var(--ipn-accent), var(--ipn-primary-shade), var(--ipn-accent));
                border-radius: inherit;
                z-index: -1;
                opacity: 0.4;
                animation: tabletBorderGlow 3.5s ease-in-out infinite;
            }

        .about-ipn iframe {
            display: block !important;
            width: 100%;
            height: 100%;
            min-height: 260px;
        }

        @keyframes tabletYoutubePulse {
            0%, 100% {
                opacity: 1;
            }

            50% {
                opacity: 0.9;
            }
        }

        @keyframes tabletPlayButtonPulse {
            0%, 100% {
                transform: translate(-50%, -50%) scale(1);
                box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            }

            50% {
                transform: translate(-50%, -50%) scale(1.03);
                box-shadow: 0 6px 20px rgba(var(--ipn-primary-rgb), 0.5);
            }
        }

        @keyframes tabletBorderGlow {
            0%, 100% {
                opacity: 0.2;
            }

            50% {
                opacity: 0.5;
            }
        }
    }

    /* ===================================
   Tablet (min-width: 500px)
   =================================== */

    @media (min-width: 500px) {
        /* FAQ section padding */
        .faq-section-container {
            padding: 40px 30px;
        }
    }

    /* ===================================
   Tablet and Below (max-width: 991px)
   =================================== */

    @media (max-width: 991px) {
        /* Adjust hero title on tablets */
        .hero-title {
            font-size: 48px;
        }

        /* Carousel CTA buttons — reduced on tablet */
        .hero .hero-content .btn {
            font-size: 0.875rem !important;
            padding: 0.5rem 1.25rem !important;
            width: auto !important;
        }

        /* Prevent body scroll when menu is open */
        body.overflow-hidden {
            overflow: hidden;
        }

        /* Side panel menu for tablets - Sticky and Full Height */
        .navbar-collapse {
            position: fixed !important;
            top: 0 !important;
            bottom: 0 !important;
            left: -100% !important;
            width: 70% !important;
            max-width: 400px !important;
            height: 100% !important;
            min-height: 100vh !important;
            background: #ffffff !important;
            z-index: 200 !important;
            transition: left 0.3s ease-in-out !important;
            overflow-y: auto !important;
            overflow-x: hidden !important;
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1) !important;
            padding: 20px 20px 80px 20px !important;  /* Extra bottom padding for scrolling */
            -webkit-overflow-scrolling: touch !important;
        }

            .navbar-collapse.show {
                left: 0 !important;
                background: #ffffff !important;
            }

            .navbar-collapse.collapsing {
                background: #ffffff !important;
                left: -100% !important;
            }

        /* Dark overlay behind the panel (tablet) - Full coverage */
        body::after {
            content: '';
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            min-height: 100vh;
            background-color: rgba(0, 0, 0, 0.5);
            z-index: 100;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease-in-out;
        }

        body.menu-open::after {
            opacity: 1;
            pointer-events: auto;
        }

        /* Prevent body scroll when menu is open (tablet) */
        body.menu-open {
            overflow: hidden !important;
            position: fixed !important;
            width: 100% !important;
            height: 100% !important;
        }

        /* Stack navigation items */
        .navbar-nav {
            padding-top: 60px;
            padding-bottom: 100px !important;  /* Extra space to ensure account section is scrollable */
            flex-direction: column;
            width: 100%;
        }

        .navbar-nav {
            background: #ffffff !important;
            flex-direction: column !important;
            gap: 0 !important;  /* Remove gap-4 from desktop */
        }

        .nav-item {
            width: 100% !important;
            border-bottom: 1px solid #d0d0d0 !important;
            background: #ffffff !important;
            margin: 0 !important;  /* Remove any Bootstrap default margin */
            padding: 0 !important;  /* Remove any nav-item padding */
        }

        .nav-link {
            padding: 15px 10px !important;
            color: var(--ipn-secondary) !important;
            font-weight: 600 !important;
            font-size: 16px !important;
            background-color: transparent !important;
            margin: 0 !important;  /* Remove any Bootstrap default margin */
            display: block !important;
            line-height: 1.5 !important;
        }

            .nav-link:hover,
            .nav-link:active {
                color: #7c3794 !important;
                background: #f9f9f9 !important;
            }

        /* Dropdown adjustments for tablets */
        .dropdown-menu {
            position: static !important;
            box-shadow: none !important;
            min-width: 100% !important;
            width: 100% !important;
            border: none !important;
            background: #fafafa !important;
            display: none;
        }

            .dropdown-menu.show {
                display: block !important;
                background: #fafafa !important;
            }

        .dropdown-item {
            padding: 12px 10px 12px 25px !important;
            color: #666666 !important;
            background: transparent !important;
        }

            .dropdown-item:hover,
            .dropdown-item:active,
            .dropdown-item:focus {
                color: var(--ipn-primary) !important;
                background: #ffffff !important;
            }

        .dropdown-submenu-menu {
            position: static !important;
            box-shadow: none !important;
            padding-left: 0 !important;
            background: #f5f5f5 !important;
            display: none;
        }

            .dropdown-submenu-menu.show {
                display: block !important;
                background: #f5f5f5 !important;
            }

            .dropdown-submenu-menu .dropdown-item {
                padding-left: 45px !important;
                color: #777777 !important;
                background: transparent !important;
            }

                .dropdown-submenu-menu .dropdown-item:hover,
                .dropdown-submenu-menu .dropdown-item:focus {
                    color: var(--ipn-primary) !important;
                    background: #ffffff !important;
                }

        .dropdown-submenu .dropdown-toggle::after {
            content: "\F282";
            float: right;
            margin-top: 8px;
        }

        /* Auth buttons are now nav-items inside the list on mobile —
           no special .d-flex overrides needed here */
    }

    /* ===================================
   Laptop (992px - 1399px) – more padding on regular laptop screens
   =================================== */

    @media (min-width: 992px) and (max-width: 1399px) {
        /* Exclude .hero and .quote-section to prevent any carousel-to-quote gap */
        section:not(.hero):not(.quote-section) {
            padding-top: 4rem;
            padding-bottom: 4rem;
        }

        /* Quote section sits flush — no top gap after carousel */
        .quote-section {
            margin-top: 0 !important;
        }

        .container {
            padding-left: 2.5rem !important;
            padding-right: 2.5rem !important;
        }

        /* Increase gap between timeline cards and innovation section */
        section.timeline {
            padding-bottom: 6rem !important;
        }

        section.innovation {
            padding-top: 6rem !important;
        }

            section.innovation .container {
                padding-top: 3rem !important;
                padding-bottom: 3rem !important;
            }
    }

    /* ===================================
   Desktop (min-width: 1024px)
   =================================== */

    @media (min-width: 1024px) {
        /* Footer: tighten desktop column spacing (esp. Quick links ↔ Stakeholders) */
        .footer .row.g-4.pb-4 {
            --bs-gutter-x: 1rem;
        }

        /* Show desktop hero sections */
        .hero {
            display: block !important;
        }

        .about-hero,
        .our-team-hero,
        .ussd-directory-hero,
        .ussd-payment-hero,
        .ussd-registration-hero {
            display: block !important;
        }

        #heroCarousel {
            display: block !important;
        }

        /* Hide tablet hero image on desktop */
        .tablet-hero-image {
            display: none !important;
        }

        /* Adjust gap between video/about section and timeline */
        section.about {
            padding-bottom: 3rem !important;
        }

            section.about .container {
                padding-bottom: 1.5rem !important;
            }

        section.timeline {
            padding-top: 1.5rem !important;
        }
    }

    /* ===================================
   Desktop (min-width: 992px)
   =================================== */

    @media (min-width: 992px) {
        /* Increase gap between timeline cards and innovation section */
        section.timeline {
            padding-bottom: 6rem !important;
        }

        section.innovation {
            padding-top: 6rem !important;
        }

            section.innovation .container {
                padding-top: 3rem !important;
                padding-bottom: 3rem !important;
            }

        /* Dropdown positioning for desktop */
        .navbar .dropdown {
            position: relative;
        }

        /* Dropdown menu positioning - NO overflow hidden for parent menus with submenus */
        .navbar .dropdown-menu {
            position: absolute;
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
        }

            /* Only apply overflow hidden to dropdown menus that DON'T have submenus */
            .navbar .dropdown-menu:not(:has(.dropdown-submenu)) {
                overflow: hidden;
            }

        /* Desktop submenu positioning */
        .navbar .dropdown-submenu-menu {
            position: absolute;
            top: 0;
            left: 100%;
            margin-left: 0;
            margin-top: 0;
            display: none;
            z-index: 1051;
            border: none;
            box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.25);
            border-radius: 0;
            padding: 0;
            min-width: 300px;
            background-color: white;
            overflow: hidden;
        }

            /* Bottom corners border radius for last items */
            .navbar .dropdown-menu > li:last-child > .dropdown-item:not(.dropdown-toggle),
            .navbar .dropdown-submenu-menu > li:last-child .dropdown-item {
                border-bottom-left-radius: 0;
                border-bottom-right-radius: 0;
            }

            /* First item styling - no top radius */
            .navbar .dropdown-menu > li:first-child .dropdown-item,
            .navbar .dropdown-submenu-menu > li:first-child .dropdown-item {
                border-top-left-radius: 0;
                border-top-right-radius: 0;
            }

            /* Ensure dropdown items don't overflow the rounded container */
            .navbar .dropdown-menu .dropdown-item:last-child:not(.dropdown-toggle),
            .navbar .dropdown-submenu-menu .dropdown-item:last-child {
                border-bottom-left-radius: 0;
                border-bottom-right-radius: 0;
            }
    }

    /* ===================================
   Loader Background Images - Screen Fill
   =================================== */

    /* Mobile Loader - Screen Fill (up to 499px) */
    @media (max-width: 499px) {
        .loader-overlay {
            background-image: url('/Loader/Loader%20Images/Mobile.webp');
            background-size: cover !important;
            background-position: center center !important;
            width: 100vw !important;
            height: 100vh !important;
            min-height: 100vh !important;
            min-height: -webkit-fill-available !important;
        }

        /* Lock body scroll on mobile while loading */
        body.loading {
            overflow: hidden !important;
            position: fixed !important;
            width: 100% !important;
            height: 100% !important;
            touch-action: none !important;
        }
    }

    /* Tablet Loader - Screen Fill (500px to 1023px) */
    @media (min-width: 500px) and (max-width: 1023px) {
        .loader-overlay {
            background-image: url('/Loader/Loader%20Images/Tablet.webp');
            background-size: cover !important;
            background-position: center center !important;
            width: 100vw !important;
            height: 100vh !important;
            min-height: 100vh !important;
            min-height: -webkit-fill-available !important;
        }

        /* Lock body scroll on tablet while loading */
        body.loading {
            overflow: hidden !important;
            position: fixed !important;
            width: 100% !important;
            height: 100% !important;
            touch-action: none !important;
        }
    }

    /* Desktop/Laptop Loader - Screen Fill (1024px and above) */
    @media (min-width: 1024px) {
        .loader-overlay {
            background-image: url('/Loader/Loader%20Images/Desktop_Laptop.webp');
            background-size: cover;
            background-position: center center;
        }
    }

    /* ===================================
   Carousel — Mobile & Tablet
   Swipe enabled, hide arrows/indicators
   =================================== */

    @media (max-width: 1023px) {
        .carousel-control-prev,
        .carousel-control-next {
            display: flex !important;
            width: 38px !important;
            height: 38px !important;
            z-index: 20 !important;
            pointer-events: auto !important;
        }

        .carousel-control-prev {
            left: 10px !important;
        }

        .carousel-control-next {
            right: 10px !important;
        }
        
        /* Keep indicators visible on mobile for swipe feedback */
        .carousel-indicators {
            display: flex !important;
            bottom: 1rem;
            z-index: 20 !important;
            pointer-events: auto !important;
        }
        
        .carousel-indicators [data-bs-target] {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin: 0 5px;
            background-color: rgba(255, 255, 255, 0.5);
            border: none;
            opacity: 0.7;
            transition: all 0.3s ease;
        }
        
        .carousel-indicators [data-bs-target].active {
            width: 12px;
            height: 12px;
            background-color: rgba(255, 255, 255, 1);
            opacity: 1;
        }

        /* Heroes were recently re-enabled on mobile/tablet.
           Move hero content closer to the navbar/top bar. */
        .carousel-item .container {
            align-items: flex-start !important;
            padding-top: 1.25rem;
        }

        section[class*="hero"] .container.h-100.d-flex.align-items-center {
            align-items: flex-start !important;
        }

        section[class*="hero"] .hero-content.py-5 {
            padding-top: 1.25rem !important;
            padding-bottom: 1.25rem !important;
        }
    }

    /* ===================================
   Print Styles
   =================================== */

    @media print {
        .top-bar,
        .navbar,
        .carousel-control-prev,
        .carousel-control-next,
        .carousel-indicators,
        .footer a[href^="#"] {
            display: none;
        }

        .hero {
            min-height: auto;
        }
    }
