/* ==================================================
 * RESPONSIVE DESIGN - MOBILE FIRST APPROACH
 * Flying Dream Company Website
 * ================================================== */

/* ========================================
   BASE STYLES (Mobile First - 320px+)
   ======================================== */

/* Ensure proper box model */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Container responsiveness */
.container {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   HEADER - MOBILE STYLES
   ======================================== */

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 70px;
    background: rgba(20, 20, 20, 0.95);
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header .container {
    max-width: 100%;
    padding: 0 15px;
}

/* Logo area on mobile */
#logo {
    flex-shrink: 0;
}

#logo img {
    max-height: 40px;
    width: auto;
}

/* Header actions wrapper */
.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Hamburger Menu Button */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.hamburger-menu:focus {
    outline: none;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    transform-origin: center;
}

/* Hamburger animation when active */
.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* Phone number on mobile */
.h-phone {
    display: none; /* Hidden on very small screens */
    font-size: 14px;
    color: #fff;
    font-weight: 600;
}

/* Main menu wrapper */
#mainmenu-wrapper {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    max-width: 300px;
    height: calc(100vh - 70px);
    background: rgba(20, 20, 20, 0.98);
    overflow-y: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

#mainmenu-wrapper.active {
    left: 0;
}

/* Main menu list */
#mainmenu {
    list-style: none;
    margin: 0;
    padding: 20px 0;
    width: 100%;
}

#mainmenu li {
    display: block;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#mainmenu li:last-child {
    border-bottom: none;
}

#mainmenu li a {
    display: block;
    padding: 15px 25px;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

#mainmenu li a:hover,
#mainmenu li a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #C8A045;
    padding-left: 30px;
}

/* Submenu on mobile */
#mainmenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    background: rgba(0, 0, 0, 0.2);
}

#mainmenu ul li a {
    padding-left: 40px;
    font-size: 14px;
}

/* Overlay for mobile menu */
.menu-overlay {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Content padding for fixed header */
#wrapper {
    padding-top: 70px;
}

/* ========================================
   TABLET STYLES (576px+) - Bootstrap SM
   ======================================== */

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }

    header .container {
        padding: 0 20px;
    }

    #logo img {
        max-height: 45px;
    }

    .h-phone {
        display: inline-block;
        font-size: 14px;
    }

    #mainmenu li a {
        font-size: 16px;
        padding: 15px 25px;
    }
    
    /* Improve grid layout */
    .col-md-6,
    .col-lg-4,
    .col-lg-6 {
        width: 100%;
        padding: 0 10px;
    }
}

/* ========================================
   SMALL TABLET STYLES (768px+) - Bootstrap MD
   ======================================== */

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }

    header .container {
        padding: 0 25px;
    }

    #logo img {
        max-height: 50px;
    }

    .h-phone {
        display: inline-block;
        font-size: 15px;
    }

    /* Still show hamburger menu at this breakpoint */
    .hamburger-menu {
        display: flex;
    }

    #mainmenu-wrapper {
        max-width: 350px;
    }

    #mainmenu li a {
        font-size: 17px;
        padding: 16px 30px;
    }

    /* Adjust content sections */
    section {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* Grid improvements */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .col-md-6 {
        width: 50%;
        padding: 0 10px;
    }
}

/* ========================================
   DESKTOP STYLES (992px+) - Bootstrap LG
   ======================================== */

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }

    header .container {
        padding: 0 30px;
    }

    /* Transition to desktop navigation */
    #mainmenu-wrapper {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        box-shadow: none;
        overflow: visible;
    }

    #mainmenu {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        margin: 0;
    }

    #mainmenu li {
        display: inline-block;
        width: auto;
        border: none;
        margin: 0 5px;
    }

    #mainmenu li a {
        display: inline-block;
        padding: 10px 15px;
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 1px;
        transition: all 0.3s ease;
    }

    #mainmenu li a:hover,
    #mainmenu li a.active {
        background: transparent;
        color: #C8A045;
        padding-left: 15px;
    }

    /* Hide hamburger on desktop */
    .hamburger-menu {
        display: none !important;
    }

    /* Show phone number on desktop */
    .h-phone {
        display: inline-block;
        font-size: 16px;
    }

    /* Remove overlay on desktop */
    .menu-overlay {
        display: none;
    }

    /* Desktop header layout */
    .de-flex {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .de-flex-col {
        display: flex;
        align-items: center;
    }

    .header-col-mid {
        flex: 1;
        justify-content: center;
    }

    #logo {
        margin-right: 20px;
    }

    .header-actions {
        margin-left: auto;
    }
    
    /* Grid layout */
    .col-lg-4,
    .col-lg-6 {
        width: 50%;
        padding: 0 15px;
    }
}

/* ========================================
   LARGE DESKTOP STYLES (1200px+) - Bootstrap XL
   ======================================== */

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    header .container {
        padding: 0 40px;
    }

    #mainmenu li {
        margin: 0 10px;
    }

    #mainmenu li a {
        padding: 10px 20px;
        font-size: 15px;
    }

    .h-phone {
        font-size: 18px;
    }
    
    /* Full grid layout */
    .col-lg-4 {
        width: 33.333333%;
    }
    
    .col-lg-6 {
        width: 50%;
    }
    
    .col-lg-8 {
        width: 66.666667%;
    }
}

/* ========================================
   SECTION RESPONSIVENESS
   ======================================== */

/* Hero section adjustments */
#section-slider {
    min-height: 100vh;
}

.tp-caption h1 {
    font-size: clamp(1.5rem, 5vw, 3rem);
    line-height: 1.2;
    padding: 0 15px;
}

.tp-caption h3 {
    font-size: clamp(1rem, 3vw, 2rem);
    padding: 0 15px;
}

.tp-caption p {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    padding: 0 15px;
}

/* Ensure all sections are responsive */
section {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Container adjustments for custom sections */
#about-modern .container,
#services-modern .container,
#career-modern .container {
    width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

/* Team section grid */
.team-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 0 15px;
}

/* Clients section */
.client-card {
    padding: 15px;
    aspect-ratio: 1/1;
}

/* Stats section */
.de_count {
    margin-bottom: 20px;
    text-align: center;
}

.de_count h3 {
    font-size: clamp(2rem, 5vw, 3rem);
}

.de_count h5 {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

/* Subheader responsiveness */
#subheader {
    padding: 80px 0;
    min-height: 400px;
}

#subheader h1 {
    font-size: clamp(2rem, 6vw, 4rem);
    margin-bottom: 15px;
}

#subheader p {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
}

/* Footer responsiveness */
footer .widget {
    margin-bottom: 30px;
}

.subfooter {
    text-align: center;
}

.social-icons {
    justify-content: center;
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

/* ========================================
   UTILITY CLASSES FOR RESPONSIVENESS
   ======================================== */

/* Spacing utilities */
.responsive-spacer {
    height: clamp(20px, 5vh, 60px);
}

/* Text sizing */
.responsive-title {
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    line-height: 1.2;
}

.responsive-subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
}

.responsive-text {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    line-height: 1.6;
}

/* Button responsiveness */
.btn-custom {
    padding: clamp(10px, 2vw, 15px) clamp(20px, 4vw, 30px);
    font-size: clamp(14px, 2vw, 16px);
    white-space: nowrap;
}

/* Image responsiveness - CRITICAL FIX */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Ensure images in containers don't overflow */
.container img,
section img {
    max-width: 100%;
    height: auto;
}

.mask img,
.cover img {
    width: 100%;
    object-fit: cover;
}

/* Prevent image overflow in all sections */
.about-image,
.post-image img {
    max-width: 100%;
    height: auto;
}

/* Card layouts */
.team-member,
.client-card {
    width: 100%;
    max-width: 100%;
}

/* Form elements */
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    max-width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
}

/* Fix overflow issues */
body {
    overflow-x: hidden;
}

.row {
    margin-left: 0;
    margin-right: 0;
}

.col-md-12,
.col-lg-12 {
    padding-left: 15px;
    padding-right: 15px;
}

/* ========================================
   ANIMATION & TRANSITION OPTIMIZATIONS
   ======================================== */

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    header,
    #menu-btn,
    .menu-overlay,
    footer {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .container {
        width: 100%;
        max-width: none;
    }
}
