/*-----------------------------------------------------------------*/
/* RESPONSIVE.CSS - Mobile-First Responsive Design (Top Bar Unchanged)
/* Add this file after your existing CSS files in landing.jsp
/*-----------------------------------------------------------------*/

/* Fix for overflow and scrolling issues */
html, body {
    overflow-x: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Base Mobile Styles */
@media (max-width: 576px) {
    html {
        font-size: 12px;
    }

    /* Main content responsive */
    .big {
        font-size: 28px;
        line-height: 36px;
        margin: 15px 0;
        text-align: center;
    }

    .small_landing_page {
        font-size: 14px;
        text-align: center;
    }

    /* Search box mobile optimization - FIXED */
    .landing-search-box {
        height: auto;
        margin: 20px 0;
        padding: 0 10px;
    }

    .landing-search-box .box-container {
        padding: 0;
        height: 50px;
        display: flex;
        width: 100%;
    }

    .landing-search-box .box-container .input-box {
        height: 50px;
        border-radius: 10px 0 0 10px;
        display: flex;
        align-items: center;
        background: white;
        flex: 1;
        min-width: 0; /* Important for flex shrinking */
    }

    .landing-search-box .box-container .button-box {
        height: 50px;
        border-radius: 0 10px 10px 0;
        width: 50px;
        min-width: 50px;
        flex-shrink: 0;
        background: #2F2F82;
        background-image: url('${sessionScope.session_media_path}/landing/img/arrow_right_small_login.png');
        background-repeat: no-repeat;
        background-position: center;
        background-size: 20px;
    }

    .landing-search-box .box-container .input-box .input-icon-box {
        width: 40px;
        min-width: 40px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .landing-search-box .box-container .input-box .input-icon-box .input-icon-content {
        width: 20px;
        height: 20px;
        position: static;
        left: auto;
        top: auto;
        transform: none;
    }

    .landing-search-box .box-container .input-box .input-field-box {
        flex: 1;
        height: 50px;
        display: flex;
        align-items: center;
        padding: 0 10px;
        min-width: 0; /* Important for flex shrinking */
    }

    .landing-search-box .box-container .input-box .input-field-box input[type="text"] {
        font-size: 14px;
        padding: 0;
        border: none;
        background: transparent;
        width: 100%;
        height: 40px;
        margin: 0;
    }

    /* MyDigital ID button mobile optimization - FIXED */
    .my-digital-id-text {
        font-size: 10px;
        padding: 4px 8px;
        line-height: 1.2;
        text-align: center;
        word-break: break-word;
        hyphens: auto;
    }

    .my-digital-id-icon {
        background-size: contain;
        width: 50px;
        min-width: 50px;
        flex-shrink: 0;
    }

    /* Fix for button styling */
    .landing-search-box .box-container button {
        display: flex;
        width: 100%;
        height: 50px;
        border: none;
        background: none;
        padding: 0;
        cursor: pointer;
    }

    /* Slider and background image adjustments */
    .flexslider .slides img {
        height: 100vh;
        object-fit: cover;
        width: 100%;
    }

    .slider-text-wrapper {
        margin-top: -150px;
        height: 300px;
        padding: 0 15px;
    }

    /* Bottom share section mobile */
    .slider-text-wrapper-bottom {
        height: auto;
        position: absolute;
        bottom: 0;
        padding: 15px 0;
        background: rgba(0, 0, 0, 0.3);
    }

    .bottom-share-box-row {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        margin: 0;
        flex-wrap: wrap;
    }

    .bottom-share-box-content-text {
        padding: 5px 10px;
        order: -1;
        width: 100%;
        text-align: center;
    }

    .bottom-share-box-content-text p {
        font-size: 14px !important;
        margin: 0;
    }

    .bottom-share-box-content {
        padding: 5px;
    }

    .share-img {
        width: 20px;
        height: 20px;
    }

    /* Modal responsive fixes */
    .modal-dialog {
        width: 95%;
        max-width: 400px;
        margin: 20px auto;
    }

    .modal-content {
        border-radius: 10px;
        min-height: auto;
    }

    .modal-body {
        padding: 20px 15px;
        margin: 0;
    }

    .modal-footer {
        padding: 15px;
        margin: 0;
    }

    /* Button mobile fixes */
    .btn_accept, .btn_login_accept, .btn_login_denied {
        height: 45px;
        font-size: 14px;
        margin-bottom: 10px;
    }

    /* Input fields mobile */
    .login-password-box, .forget-email-box {
        height: 45px;
        margin: 10px 0;
        display: flex;
        align-items: center;
    }

    .login-password-box input[type="password"],
    .forget-email-box input[type="text"] {
        height: 40px;
        font-size: 14px;
        margin-bottom: 0;
    }

    .dialog-icon {
        width: 20px;
        height: 20px;
        position: static;
        top: auto;
        left: auto;
        transform: none;
    }

    .dialog-icon-box {
        width: 40px;
        min-width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }

    /* Footer mobile */
    footer {
        padding: 20px 0;
    }

    .social-icons {
        text-align: center;
        margin-top: 15px;
    }

    .social-icons ul li {
        display: inline-block;
        margin: 0 5px;
    }

    .copyright {
        text-align: center;
        margin-top: 10px;
    }

    /* Container fixes */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .row {
        margin-left: -5px;
        margin-right: -5px;
    }

    .col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, 
    .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12 {
        padding-left: 5px;
        padding-right: 5px;
    }

    /* Fix for responsive text sizing */
    h4 {
        font-size: 14px;
    }

    p, pr {
        font-size: 13px;
        line-height: 1.4;
    }

    /* Loading modal mobile */
    .loadingGifMargin {
        margin: 20px 0;
        max-width: 60px;
    }

    .error-title {
        font-size: 18px;
        line-height: 1.4;
    }

    /* Security phrase modal mobile */
    .roundPhraseImage {
        width: 80px;
        border-width: 5px;
        margin-bottom: 15px;
    }
}

/* Small mobile devices (iPhone SE, etc.) */
@media (max-width: 375px) {
    .big {
        font-size: 24px;
        line-height: 30px;
    }

    .landing-search-box .box-container {
        height: 45px;
    }

    .landing-search-box .box-container .input-box,
    .landing-search-box .box-container .button-box {
        height: 45px;
    }

    .my-digital-id-text {
        font-size: 9px;
        padding: 2px 4px;
    }

    .modal-dialog {
        width: 98%;
        margin: 10px auto;
    }

    .share-img {
        width: 18px;
        height: 18px;
    }
}

/* Tablet portrait adjustments */
@media (min-width: 577px) and (max-width: 768px) {
    .big {
        font-size: 32px;
        line-height: 40px;
    }

    .landing-search-box .box-container {
        height: 55px;
        padding: 0 5%;
    }

    .bottom-share-box-row {
        flex-direction: row;
        justify-content: center;
    }

    .modal-dialog {
        width: 80%;
        max-width: 500px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .slider-text-wrapper {
        margin-top: -100px;
        height: 200px;
    }

    .big {
        font-size: 20px;
        line-height: 24px;
        margin: 5px 0;
    }

    .flexslider .slides img {
        height: 100vh;
        object-fit: cover;
    }

    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-content {
        max-height: 90vh;
    }

    .modal-body {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* Focus and accessibility improvements for mobile */
@media (max-width: 768px) {
    .form-control:focus,
    .landing-search-box .box-container .input-box .input-field-box input[type="text"]:focus {
        border-color: #FFD963 !important;
        box-shadow: 0 0 0 2px rgba(255, 217, 99, 0.25) !important;
        outline: none !important;
    }

    /* Improved touch targets */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }
}

/* Fix for very wide mobile screens */
@media (min-width: 577px) and (max-width: 991px) {
    .landing-search-box .box-container {
        padding: 0 8%;
    }

    .big {
        font-size: 36px;
        line-height: 44px;
    }
}

/* High DPI displays optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .landing-search-box .box-container .input-box .input-icon-box .input-icon-content,
    .share-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Additional Bootstrap grid fixes for mobile */
@media (max-width: 576px) {
    .col-xs-1 { width: 8.33333333%; }
    .col-xs-2 { width: 16.66666667%; }
    .col-xs-3 { width: 25%; }
    .col-xs-4 { width: 33.33333333%; }
    .col-xs-5 { width: 41.66666667%; }
    .col-xs-6 { width: 50%; }
    .col-xs-7 { width: 58.33333333%; }
    .col-xs-8 { width: 66.66666667%; }
    .col-xs-9 { width: 75%; }
    .col-xs-10 { width: 83.33333333%; }
    .col-xs-11 { width: 91.66666667%; }
    .col-xs-12 { width: 100%; }
}

/* Fix for spacing utilities on mobile */
@media (max-width: 576px) {
    .plr-2-5rem {
        padding: 0 1rem;
    }
    
    .w-98vw {
        width: 100%;
    }
    
    .m-10 {
        margin: 5px;
    }
}

/* Touch improvements */
@media (max-width: 768px) {
    .btn, .landing-search-box .box-container .button-box,
    .landing-search-box .box-container .input-box,
    .my-digital-id-icon {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

/* Dark mode support for mobile (if needed) */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .modal-content {
        background-color: #1a1a1a;
        color: white;
    }

    .form-control {
        background-color: #2a2a2a;
        color: white;
        border-color: #444;
    }
}