/**
 * UI Fixes for NAJ Logistics Express
 *
 * This file contains critical fixes for:
 * 1. Removing sticky header behavior
 * 2. Fixing contact form z-index issues
 * 3. Ensuring proper layout and responsive behavior
 */

/* ============================================================================
   FIX 1: REMOVE STICKY HEADER / AFFIX BEHAVIOR
   ============================================================================ */

/* Ensure header stays static and doesn't become fixed */
.header_menu,
.middle_menu_area,
.header_white_menu {
    position: relative !important;
    top: auto !important;
    width: 100% !important;
    z-index: 999;
}

/* Remove any affix-related styles */
.header_menu.affix,
.header_menu.affix-top,
.header_menu.affix-bottom,
.middle_menu_area.affix,
.middle_menu_area.affix-top,
.middle_menu_area.affix-bottom,
.header_white_menu.affix,
.header_white_menu.affix-top,
.header_white_menu.affix-bottom {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    transform: none !important;
}

/* Ensure main header area is properly positioned */
.main_header_area {
    position: relative;
    z-index: 999;
    background: #fff;
    width: 100%;
}

/* Reset any margin adjustments that were made for sticky header */
.slider_area.mr_top {
    margin-top: 0 !important;
}

/* Ensure navbar doesn't create layout shifts */
.navbar-fixed-top {
    position: relative !important;
}

/* ============================================================================
   FIX 2: CONTACT FORM Z-INDEX AND LAYOUT ISSUES
   ============================================================================ */

/* Fix getintouch section layout */
.getintouch-section {
    width: 100%;
    float: left;
    padding: 60px 0px;
    background-color: #2957a9;
    position: relative;
    overflow: hidden;
}

.getintouch-main {
    width: 100%;
    float: left;
    position: relative;
    min-height: 500px;
}

/* Ensure the form has proper stacking context */
.getintouch-main form {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 40px;
    background: rgba(41, 87, 169, 0.95);
    border-radius: 5px;
}

/* Fix image panel positioning to prevent overlap */
.getintouch-imgpanel {
    width: 35%;
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-align: right;
    pointer-events: none;
}

.getintouch-imgpanel img {
    max-width: 100%;
    height: auto;
    display: block;
    margin-left: auto;
}

/* Ensure form elements are above the image */
.getintouch-main .form-control,
.getintouch-main .theme-btn,
.getintouch-main .page-heading {
    position: relative;
    z-index: 15;
}

/* Better spacing for the form */
.getintouch-main .page-heading {
    padding-bottom: 30px;
    text-align: left;
    position: relative;
    z-index: 15;
}

.getintouch-main .page-heading h5 {
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.getintouch-main .page-heading h2 {
    color: #fff;
    font-size: 48px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Form styling improvements */
.getintouch-main .form-control {
    height: 55px;
    padding: 15px 20px;
    background: #fff;
    font-size: 16px;
    color: #3c3e41;
    font-weight: 400;
    border-radius: 3px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.getintouch-main .form-control:focus {
    border-color: #82b927;
    box-shadow: 0 0 10px rgba(130, 185, 39, 0.3);
    outline: none;
}

.getintouch-main textarea.form-control {
    height: 150px;
    resize: vertical;
    min-height: 100px;
    max-height: 300px;
}

/* Button styling */
.getintouch-main .theme-btn {
    background: #82b927;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-radius: 3px;
    padding: 15px 40px;
    border: 2px solid #82b927;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.getintouch-main .theme-btn:hover,
.getintouch-main .theme-btn:focus {
    background: #fff;
    color: #2957a9;
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 992px) {
    /* Stack form layout on tablets */
    .getintouch-imgpanel {
        width: 50%;
        position: static;
        margin: 30px auto 0;
        text-align: center;
    }

    .getintouch-main form {
        padding: 30px 20px;
    }

    .getintouch-main .page-heading h2 {
        font-size: 36px;
    }

    .getintouch-main .page-heading h5 {
        font-size: 28px;
    }
}

@media (max-width: 767px) {
    /* Mobile optimizations */
    .getintouch-section {
        padding: 40px 0px;
    }

    .getintouch-main {
        min-height: auto;
    }

    .getintouch-imgpanel {
        width: 70%;
        margin: 20px auto 0;
    }

    .getintouch-main form {
        padding: 20px 15px;
    }

    .getintouch-main .page-heading {
        padding-bottom: 20px;
    }

    .getintouch-main .page-heading h2 {
        font-size: 28px;
    }

    .getintouch-main .page-heading h5 {
        font-size: 20px;
    }

    .getintouch-main .form-control {
        height: 50px;
        font-size: 14px;
    }

    .getintouch-main textarea.form-control {
        height: 120px;
    }

    .getintouch-main .theme-btn {
        padding: 12px 30px;
        font-size: 14px;
    }
}

/* ============================================================================
   ADDITIONAL LAYOUT IMPROVEMENTS
   ============================================================================ */

/* Ensure smooth transitions are maintained */
.header_menu .navbar-nav > li > a {
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Fix any potential overflow issues */
body {
    overflow-x: hidden;
}

/* Ensure container widths are respected */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Fix for mobile menu functionality */
@media (max-width: 992px) {
    .main_header_area {
        position: relative !important;
    }

    .header_menu {
        position: relative !important;
    }
}

/* Ensure no console errors from missing elements */
.offcanvas_closer {
    transition: opacity 0.3s ease;
}

/* ============================================================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================================================ */

/* Better focus states for keyboard navigation */
.getintouch-main .form-control:focus,
.getintouch-main .theme-btn:focus {
    outline: 3px solid rgba(130, 185, 39, 0.5);
    outline-offset: 2px;
}

/* Ensure proper contrast ratios */
.getintouch-main input::placeholder,
.getintouch-main textarea::placeholder {
    color: #666;
    opacity: 1;
}

/* ============================================================================
   FIX 3: WHY CHOOSE US SECTION COLOR IMPROVEMENTS
   ============================================================================ */

/* Set section background to the requested blue color */
.whychooseus-section {
    background-color: #034a8f !important;
    color: #fff;
}

/* Update company panel text colors for better contrast */
.ourcompany-panel h2 {
    color: #fff !important;
}

.ourcompany-panel h2 span {
    color: #82b927 !important; /* Use the green accent color for "OUR COMPANY" */
}

.ourcompany-panel p {
    color: #fff !important;
    opacity: 0.9;
}

/* Improve panel styling for better visibility */
.whychooseus-panel {
    background: rgba(255, 255, 255, 0.95) !important;
    color: #034a8f !important;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.whychooseus-panel h3 {
    color: #034a8f !important;
}

.whychooseus-panel h3 strong {
    color: #034a8f !important;
}

/* Enhance overlay backgrounds for image panels */
.whychooseus-panel .overlay {
    background: rgba(3, 74, 143, 0.85) !important;
    backdrop-filter: blur(2px);
}

.whychooseus-panel .overlay h3 {
    color: #fff !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Improve hover effects */
.whychooseus-panel:hover {
    transform: scale(1.03) !important;
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.15) !important;
    border-color: #82b927;
}

/* Ensure proper spacing and layout */
.whychooseus-gridmain {
    padding: 60px 0px 30px 0px;
}

/* ============================================================================
   PRINT STYLES (OPTIONAL)
   ============================================================================ */

@media print {
    .header_menu,
    .getintouch-imgpanel {
        display: none;
    }

    .getintouch-main form {
        background: transparent;
        border: 1px solid #ccc;
    }
}