/* ========================================
   RESPONSIVE OPTIMIZATION & PERFORMANCE
   ======================================== */

/* ===== SMOOTH TRANSITIONS & PERFORMANCE ===== */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Optimize images for faster loading */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== BUTTON OPTIMIZATION ===== */
.cmn-btn {
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    touch-action: manipulation !important;
    will-change: transform, background-color !important;
}

.cmn-btn:hover {
    transform: translateY(-2px) !important;
}

.cmn-btn:active {
    transform: translateY(0) !important;
    transition: all 0.1s ease !important;
}

/* ===== MOBILE RESPONSIVE FIXES ===== */

/* Extra Small Devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .cmn-btn {
        padding: 12px 25px !important;
        font-size: 14px !important;
        min-width: 140px !important;
    }
    
    .navbar-brand .company-name {
        max-width: 180px !important;
        font-size: 11px !important;
        line-height: 1.2 !important;
    }
    
    .section-header h2 {
        font-size: 24px !important;
        line-height: 1.3 !important;
    }
    
    .section-header p {
        font-size: 14px !important;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .cmn-btn {
        padding: 13px 30px !important;
        font-size: 15px !important;
    }
    
    .navbar-brand .company-name {
        font-size: 13px !important;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .cmn-btn {
        padding: 14px 35px !important;
        font-size: 15px !important;
    }
    
    .navbar-brand .company-name {
        font-size: 15px !important;
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .cmn-btn {
        padding: 15px 40px !important;
    }
    
    .navbar-brand .company-name {
        font-size: 16px !important;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .cmn-btn {
        padding: 16px 45px !important;
    }
}

/* ===== NAVIGATION RESPONSIVE ===== */
.header-section {
    position: relative;
    z-index: 1000;
}

.navbar-toggler {
    border: none !important;
    padding: 8px !important;
    transition: all 0.3s ease !important;
}

.navbar-toggler:focus {
    box-shadow: none !important;
    outline: none !important;
}

.navbar-collapse {
    transition: all 0.3s ease-in-out !important;
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #fff;
        padding: 20px;
        border-radius: 10px;
        margin-top: 15px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }
    
    .navbar-nav .nav-item {
        margin: 8px 0;
    }
    
    .navbar-nav .nav-link {
        padding: 10px 15px !important;
        border-radius: 5px;
        transition: all 0.2s ease;
    }
    
    .navbar-nav .nav-link:hover {
        background: #f5faff;
        padding-left: 20px !important;
    }
    
    .right-area {
        margin-top: 15px;
    }
}

/* ===== FORM RESPONSIVE ===== */
@media (max-width: 767.98px) {
    .form-group input,
    .form-group textarea,
    .single-input input,
    .single-input textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}

/* ===== FOOTER RESPONSIVE ===== */
@media (max-width: 767.98px) {
    .footer-section .footer-box {
        text-align: center;
        margin-bottom: 30px;
    }
    
    .footer-section .social-link {
        justify-content: center;
    }
}

/* ===== BANNER RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .banner-section .overlay .banner-content {
        padding: 150px 0 100px !important;
    }
    
    .banner-section .main-content .bottom-area {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .banner-section .main-content .bottom-area .cmn-btn {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* ===== CARD & BOX RESPONSIVE ===== */
@media (max-width: 767.98px) {
    .single-box,
    .plan-box,
    .blog-item {
        margin-bottom: 20px;
    }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Reduce animations on low-end devices */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU acceleration for smooth animations */
.cmn-btn,
.navbar-collapse,
.dropdown-menu {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Optimize hover effects for touch devices */
@media (hover: none) and (pointer: coarse) {
    .cmn-btn:hover {
        transform: none !important;
    }
    
    .cmn-btn:active {
        transform: scale(0.98) !important;
    }
}

/* ===== LOADING OPTIMIZATION ===== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== ACCESSIBILITY & TOUCH TARGETS ===== */
@media (max-width: 767.98px) {
    /* Ensure touch targets are at least 44x44px */
    .cmn-btn,
    .nav-link,
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (max-width: 991.98px) and (orientation: landscape) {
    .banner-section .overlay .banner-content {
        padding: 100px 0 80px !important;
    }
    
    .section-header {
        margin-bottom: 30px !important;
    }
}

/* ===== ULTRA-WIDE SCREENS ===== */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
}

/* ===== PRINT OPTIMIZATION ===== */
@media print {
    .header-section,
    .footer-section,
    .cmn-btn,
    .preloader {
        display: none !important;
    }
}
