/* ================================================================
   Mobile Responsive Enhancement CSS
   Created: 2025
   Purpose: Ensure full mobile compatibility across all devices
================================================================ */

/* ================================================================
   1. BASE MOBILE STYLES
================================================================ */

/* Prevent horizontal scroll on mobile */
body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Smooth scrolling for mobile */
html {
    scroll-behavior: smooth;
}

/* Better touch targets for mobile */
a, button, input[type="submit"], input[type="button"] {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* Image responsiveness */
img {
    max-width: 100%;
    height: auto;
}

/* ================================================================
   2. TYPOGRAPHY MOBILE ADJUSTMENTS
================================================================ */

/* Extra small devices (phones, less than 576px) */
@media only screen and (max-width: 575.98px) {
    h1, .h1 {
        font-size: 36px !important;
        line-height: 1.3 !important;
    }
    
    h2, .h2 {
        font-size: 28px !important;
        line-height: 1.3 !important;
    }
    
    h3, .h3 {
        font-size: 24px !important;
        line-height: 1.4 !important;
    }
    
    h4, .h4 {
        font-size: 20px !important;
        line-height: 1.4 !important;
    }
    
    h5, .h5 {
        font-size: 18px !important;
    }
    
    h6, .h6 {
        font-size: 16px !important;
    }
    
    p, body {
        font-size: 14px !important;
        line-height: 1.7 !important;
    }
}

/* Small devices (landscape phones, 576px to 767px) */
@media only screen and (min-width: 576px) and (max-width: 767.98px) {
    h1, .h1 {
        font-size: 42px !important;
    }
    
    h2, .h2 {
        font-size: 32px !important;
    }
}

/* ================================================================
   3. HEADER & NAVIGATION MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 991.98px) {
    /* Header adjustments */
    .header {
        padding: 10px 0 !important;
    }
    
    .header .navbar-brand {
        max-width: 150px !important;
    }
    
    .header .navbar-brand img {
        max-height: 40px !important;
        width: auto !important;
    }
    
    /* Mobile menu toggler */
    .header .navbar-toggler {
        padding: 8px 10px !important;
        margin-right: 0 !important;
        border: none !important;
        z-index: 9999 !important;
    }
    
    /* Mobile menu */
    .header .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        max-height: 80vh;
        overflow-y: auto;
        padding: 20px 0;
        z-index: 9998;
    }
    
    .header .main-menu .navbar-nav {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .header .main-menu .nav-item {
        width: 100% !important;
        text-align: center !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .header .main-menu .nav-link {
        padding: 10px 20px !important;
        display: block !important;
        font-size: 16px !important;
    }
    
    /* Dropdown mobile styles */
    .header .dropdown-menu {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        border: none !important;
        background: #f8f9fa !important;
        margin: 10px 20px !important;
        border-radius: 5px !important;
    }
    
    .header .dropdown-item {
        padding: 10px 20px !important;
        font-size: 14px !important;
    }
    
    /* Mobile button in nav */
    .header .navbar-btn-resp {
        margin-top: 15px !important;
        text-align: center !important;
    }
}

/* Extra mobile optimization */
@media only screen and (max-width: 575.98px) {
    .header .navbar-brand {
        max-width: 120px !important;
    }
    
    .header .navbar-brand img {
        max-height: 35px !important;
    }
}

/* ================================================================
   4. HERO SECTION MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 991.98px) {
    .hero-banner {
        padding: 80px 0 60px !important;
        min-height: auto !important;
    }
    
    .hero-inner h1 {
        margin-bottom: 20px !important;
    }
    
    .hero-inner h2 {
        margin-bottom: 25px !important;
    }
    
    .hero-img-resp {
        margin-top: 40px !important;
    }
    
    /* Hide or adjust hero decorative elements on mobile */
    .hero-social-list {
        display: none !important;
    }
    
    .hero-email-link {
        display: none !important;
    }
    
    .scroll-down-btn {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        margin: 30px auto 0 !important;
        display: block !important;
        width: fit-content !important;
    }
}

@media only screen and (max-width: 575.98px) {
    .hero-banner {
        padding: 60px 0 40px !important;
    }
    
    .hero-inner {
        padding: 0 15px !important;
    }
    
    .hero-img {
        max-width: 280px !important;
        margin: 0 auto !important;
    }
}

/* ================================================================
   5. SECTIONS MOBILE PADDING & SPACING
================================================================ */

@media only screen and (max-width: 991.98px) {
    .section {
        padding: 60px 0 !important;
    }
    
    .section .section-heading {
        margin-bottom: 35px !important;
    }
}

@media only screen and (max-width: 575.98px) {
    .section {
        padding: 40px 0 !important;
    }
    
    .section .section-heading {
        margin-bottom: 25px !important;
    }
    
    .section .section-heading h2 {
        font-size: 28px !important;
    }
}

/* ================================================================
   6. GRID & COLUMNS MOBILE SPACING
================================================================ */

@media only screen and (max-width: 767.98px) {
    /* Add spacing between stacked columns on mobile */
    [class*="col-"] {
        margin-bottom: 30px;
    }
    
    .row > [class*="col-"]:last-child {
        margin-bottom: 0;
    }
    
    /* Service items, portfolio items, blog items */
    .service-item,
    .portfolio-item,
    .blog-item,
    .team-member,
    .testimonial-item {
        margin-bottom: 30px !important;
    }
}

/* ================================================================
   7. BUTTONS MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 575.98px) {
    .primary-btn,
    .white-btn,
    .btn,
    .button {
        padding: 12px 25px !important;
        font-size: 14px !important;
        width: auto !important;
        display: inline-block !important;
    }
    
    /* Full width buttons on mobile if needed */
    .btn-block-mobile {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
    }
}

/* ================================================================
   8. FORMS MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 767.98px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        width: 100% !important;
        padding: 12px 15px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        margin-bottom: 15px !important;
    }
    
    .form-group {
        margin-bottom: 20px !important;
    }
    
    label {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }
}

/* ================================================================
   9. FOOTER MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 991.98px) {
    .footer {
        text-align: center !important;
    }
    
    .footer-widget {
        margin-bottom: 40px !important;
    }
    
    .footer-widget-resp {
        margin-bottom: 30px;
    }
    
    .footer-widget-resp:last-child {
        margin-bottom: 0;
    }
    
    .footer-social-links {
        justify-content: center !important;
        margin-top: 20px !important;
    }
    
    .footer-links {
        text-align: center !important;
    }
    
    .footer-contact-info-wrap {
        text-align: center !important;
    }
}

@media only screen and (max-width: 575.98px) {
    .footer-title {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }
    
    .footer-desc {
        font-size: 14px !important;
    }
    
    .footer-logo {
        max-width: 150px !important;
        margin: 0 auto 15px !important;
    }
    
    .copyright-text {
        font-size: 13px !important;
        padding: 20px 0 !important;
    }
}

/* ================================================================
   10. PORTFOLIO/GALLERY MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 767.98px) {
    .portfolio-item {
        width: 100% !important;
        margin-bottom: 20px !important;
    }
    
    .portfolio-filter {
        text-align: center !important;
        margin-bottom: 30px !important;
    }
    
    .portfolio-filter button {
        padding: 8px 15px !important;
        font-size: 14px !important;
        margin: 5px !important;
    }
}

/* ================================================================
   11. BLOG/ARTICLE MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 767.98px) {
    .blog-item {
        margin-bottom: 30px !important;
    }
    
    .blog-content {
        padding: 20px 15px !important;
    }
    
    .blog-meta {
        font-size: 13px !important;
        flex-wrap: wrap !important;
    }
    
    .blog-meta span {
        margin: 5px 10px 5px 0 !important;
    }
}

/* ================================================================
   12. SIDEBAR MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 991.98px) {
    .sidebar {
        margin-top: 50px !important;
    }
    
    .sidebar .widget {
        margin-bottom: 30px !important;
    }
}

/* ================================================================
   13. BREADCRUMB MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 767.98px) {
    .breadcrumb-section {
        padding: 60px 0 40px !important;
    }
    
    .breadcrumb {
        font-size: 13px !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    
    .page-title {
        font-size: 28px !important;
        margin-bottom: 15px !important;
    }
}

/* ================================================================
   14. TESTIMONIAL/SLIDER MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 767.98px) {
    .testimonial-item {
        padding: 20px 15px !important;
    }
    
    .testimonial-text {
        font-size: 14px !important;
    }
    
    .owl-carousel .owl-nav button {
        width: 40px !important;
        height: 40px !important;
        font-size: 18px !important;
    }
    
    .owl-carousel .owl-dots {
        margin-top: 20px !important;
    }
}

/* ================================================================
   15. COUNTER/STATS MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 767.98px) {
    .counter-item {
        margin-bottom: 30px !important;
        text-align: center !important;
    }
    
    .counter-number {
        font-size: 32px !important;
    }
    
    .counter-title {
        font-size: 16px !important;
    }
}

/* ================================================================
   16. CONTACT SECTION MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 767.98px) {
    .contact-info {
        margin-bottom: 30px !important;
        text-align: center !important;
    }
    
    .contact-form {
        padding: 20px 15px !important;
    }
    
    .contact-info-item {
        padding: 20px !important;
        margin-bottom: 15px !important;
    }
}

/* ================================================================
   17. SKILLS/PROGRESS BARS MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 767.98px) {
    .skill-item {
        margin-bottom: 25px !important;
    }
    
    .progress {
        height: 8px !important;
    }
    
    .skill-title {
        font-size: 14px !important;
    }
}

/* ================================================================
   18. TEAM MEMBERS MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 767.98px) {
    .team-member {
        margin-bottom: 30px !important;
        text-align: center !important;
    }
    
    .team-member img {
        max-width: 250px !important;
        margin: 0 auto 15px !important;
    }
}

/* ================================================================
   19. QUICK ACCESS BUTTONS MOBILE
================================================================ */

@media only screen and (max-width: 767.98px) {
    .scroll-top-btn,
    .scroll-phone-btn,
    .scroll-facebook-btn {
        width: 45px !important;
        height: 45px !important;
        font-size: 18px !important;
        line-height: 45px !important;
    }
    
    .scroll-phone-btn {
        bottom: 20px !important;
        right: 20px !important;
    }
    
    .scroll-facebook-btn {
        bottom: 75px !important;
        right: 20px !important;
    }
    
    .scroll-top-btn {
        bottom: 20px !important;
        right: 20px !important;
    }
}

/* ================================================================
   20. PRELOADER MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 575.98px) {
    #preloader-wrap .preloader-inner {
        width: 60px !important;
        height: 60px !important;
    }
}

/* ================================================================
   21. TABLE MOBILE RESPONSIVENESS
================================================================ */

@media only screen and (max-width: 767.98px) {
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    table {
        font-size: 14px !important;
    }
    
    table th,
    table td {
        padding: 10px 8px !important;
    }
}

/* ================================================================
   22. VIDEO RESPONSIVENESS
================================================================ */

.video-wrapper,
.embed-responsive,
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe,
.embed-responsive iframe,
.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ================================================================
   23. MODAL MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 575.98px) {
    .modal-dialog {
        margin: 10px !important;
    }
    
    .modal-content {
        border-radius: 10px !important;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px !important;
    }
    
    .modal-title {
        font-size: 18px !important;
    }
}

/* ================================================================
   24. PAGINATION MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-width: 575.98px) {
    .pagination {
        font-size: 14px !important;
        justify-content: center !important;
    }
    
    .page-link {
        padding: 8px 12px !important;
        margin: 0 2px !important;
    }
}

/* ================================================================
   25. UTILITY CLASSES FOR MOBILE
================================================================ */

/* Hide on mobile */
@media only screen and (max-width: 767.98px) {
    .d-mobile-none {
        display: none !important;
    }
}

/* Show only on mobile */
.d-mobile-only {
    display: none !important;
}

@media only screen and (max-width: 767.98px) {
    .d-mobile-only {
        display: block !important;
    }
}

/* Text alignment mobile */
@media only screen and (max-width: 767.98px) {
    .text-mobile-center {
        text-align: center !important;
    }
    
    .text-mobile-left {
        text-align: left !important;
    }
    
    .text-mobile-right {
        text-align: right !important;
    }
}

/* Mobile spacing utilities */
@media only screen and (max-width: 767.98px) {
    .p-mobile-0 { padding: 0 !important; }
    .p-mobile-1 { padding: 0.25rem !important; }
    .p-mobile-2 { padding: 0.5rem !important; }
    .p-mobile-3 { padding: 1rem !important; }
    .p-mobile-4 { padding: 1.5rem !important; }
    .p-mobile-5 { padding: 3rem !important; }
    
    .m-mobile-0 { margin: 0 !important; }
    .m-mobile-1 { margin: 0.25rem !important; }
    .m-mobile-2 { margin: 0.5rem !important; }
    .m-mobile-3 { margin: 1rem !important; }
    .m-mobile-4 { margin: 1.5rem !important; }
    .m-mobile-5 { margin: 3rem !important; }
}

/* ================================================================
   26. TOUCH IMPROVEMENTS
================================================================ */

/* Better touch experience for iOS */
button,
input[type="submit"],
input[type="button"],
a {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Smooth momentum scrolling for iOS */
.modal,
.navbar-collapse,
.sidebar,
.overflow-scroll {
    -webkit-overflow-scrolling: touch;
}

/* ================================================================
   27. LANDSCAPE MOBILE OPTIMIZATION
================================================================ */

@media only screen and (max-height: 500px) and (orientation: landscape) {
    .hero-banner {
        min-height: auto !important;
        padding: 40px 0 !important;
    }
    
    .section {
        padding: 40px 0 !important;
    }
    
    .header {
        padding: 8px 0 !important;
    }
}

/* ================================================================
   28. ACCESSIBILITY FOR MOBILE
================================================================ */

/* Ensure focus states are visible on mobile */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Better readability for mobile */
@media only screen and (max-width: 767.98px) {
    body {
        font-size: 16px; /* Prevents zoom on iOS */
        line-height: 1.6;
    }
}

/* ================================================================
   END OF MOBILE RESPONSIVE CSS
================================================================ */
