/* ========================================
   Mobile & Tablet Responsive Enhancements
   ======================================== */

/* Touch-friendly elements */
@media (max-width: 1024px) {
    /* Increase tap target sizes for better touch interaction */
    .cmn-btn, button, a.btn, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
    }
    
    /* Better spacing for touch */
    .navbar-nav li {
        padding: 8px 15px;
    }
    
    /* Improved dropdown menus */
    .dropdown-menu {
        min-width: 200px;
        padding: 12px 0;
    }
    
    .dropdown-item {
        padding: 12px 20px;
        font-size: 16px;
    }
}

/* Tablet View (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Container adjustments */
    .custom-container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    /* Grid improvements */
    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .row > * {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Card layouts */
    .service-card, .provider-card, .blog-card {
        margin-bottom: 20px;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 20px;
    }
    
    input.form-control, textarea.form-control, select.form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 15px;
    }
    
    /* Tables - make scrollable */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Navigation improvements */
    .navbar-collapse {
        background: #fff;
        padding: 20px;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        margin-top: 15px;
    }
    
    /* Footer adjustments */
    .footer-widget {
        margin-bottom: 30px;
    }
    
    /* Trusted Clients Section */
    .trusted-clients-section-wraper {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .trusted-clients-section-wraper .text-part {
        max-width: 100%;
        width: 100%;
        font-size: 1rem;
        text-align: center;
    }
    
    .client-slider-wraper {
        width: 100%;
        max-width: 100%;
    }
    
    .client-slider-item-wraper .client-slider-item {
        padding: 0 30px;
        max-width: 200px;
    }
    
    /* App Download Section */
    .app-version-section .appversion-wraper {
        flex-direction: column;
        padding: 30px 20px;
        text-align: center;
    }
    
    .app-version-section .content-part {
        width: 100%;
        text-align: center;
    }
    
    .app-version-section .btn-wraper {
        justify-content: center;
        margin-top: 20px;
    }
    
    .app-version-section .app-version-image-part {
        width: 100%;
        max-width: 200px;
        margin: 20px auto 0;
    }
    
    /* Ensure text is visible on primary-bg (dark background) */
    .primary-bg .white-text {
        color: #fff !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }
    
    /* Ensure text is visible on secondary-bg (light background) */
    .secondary-bg .black-text {
        color: #000 !important;
        text-shadow: none;
    }
}

/* Mobile View (max-width: 767px) */
@media (max-width: 767px) {
    /* Typography */
    body {
        font-size: 14px;
        line-height: 1.6;
    }
    
    h1, .main-title {
        font-size: 1.75rem !important;
        line-height: 1.3;
    }
    
    h2, .title-2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
    }
    
    h3, .title-3 {
        font-size: 1.25rem !important;
    }
    
    h4, .subtitle-1 {
        font-size: 1.125rem !important;
    }
    
    /* Container */
    .custom-container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Sections padding */
    .pat-120 {
        padding-top: 60px !important;
    }
    
    .pab-120 {
        padding-bottom: 60px !important;
    }
    
    .pat-60 {
        padding-top: 40px !important;
    }
    
    .pab-60 {
        padding-bottom: 40px !important;
    }
    
    /* Navigation */
    .navbar {
        padding: 12px 0;
    }
    
    .nav-container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        position: relative;
        gap: 10px;
    }
    
    .logo-wrapper {
        flex: 0 0 auto;
        max-width: 150px;
        min-width: 100px;
        overflow: visible !important;
        height: 40px;
        display: flex;
        align-items: center;
    }
    
    /* Override main CSS overflow: hidden */
    .navbar-brand {
        max-width: 150px !important;
        width: auto !important;
        height: 40px !important;
        display: flex !important;
        align-items: center;
        overflow: visible !important; /* Override overflow: hidden from main CSS */
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .navbar-brand img,
    .logo-wrapper img {
        max-width: 150px !important;
        width: auto !important;
        height: 40px !important;
        max-height: 40px !important;
        object-fit: contain !important;
        object-position: left center !important;
        display: block !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .responsive-mobile-menu {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 0 0 auto;
    }
    
    .navbar-toggler {
        padding: 10px 12px;
        font-size: 20px;
        border: none;
        background-color: var(--primary-color) !important;
        color: #fff !important;
        border-radius: 8px;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .responsive-mobile-menu .cmn-btn {
        display: none !important; /* Hide Get Started button in top bar on mobile */
    }
    
    .responsive-mobile-menu .provider-after-login-button {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    
    .responsive-mobile-menu .provider-after-login-button img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .user-avatar-fallback {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--primary-color);
        color: #fff;
        border-radius: 50%;
    }
    
    /* Hide desktop navigation */
    .navbar-right-content {
        display: none !important;
    }
    
    .navbar-collapse {
        background: #fff;
        padding: 20px 15px;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        margin-top: 15px;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .navbar-nav {
        margin-bottom: 15px;
    }
    
    .navbar-nav li {
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .navbar-nav li:last-child {
        border-bottom: none;
    }
    
    .navbar-nav a {
        font-size: 16px;
        display: block;
        padding: 8px 0;
    }
    
    /* Mobile menu CTA button */
    .mobile-menu-cta {
        padding-top: 15px;
        border-top: 2px solid #f0f0f0;
        margin-top: 15px;
    }
    
    .mobile-menu-cta .cmn-btn {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 16px;
        font-weight: 600;
    }
    
    /* Sub-menus */
    .sub-menu {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        padding-left: 20px !important;
        margin-top: 10px;
    }
    
    /* Buttons */
    .cmn-btn {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 16px;
    }
    
    .btn-wraper {
        margin-top: 20px;
    }
    
    /* Section title with button */
    .section-title-wraper {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        gap: 20px !important;
    }
    
    .section-title-wraper .title-part {
        width: 100%;
        text-align: center;
    }
    
    .section-title-wraper .btn-wraper {
        width: 100%;
        margin-top: 0;
    }
    
    .section-title-wraper .btn-wraper .cmn-btn {
        width: 100%;
        display: block;
        margin: 0 auto;
    }
    
    /* Hero Section - Banner buttons alignment */
    .hero-section .banner-bottom-part {
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 30px 0;
    }
    
    .hero-section .banner-btn-wraper {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 400px;
        margin: 0 auto;
        gap: 12px !important;
    }
    
    .hero-section .banner-btn-wraper .cmn-btn {
        flex: 1 1 calc(50% - 6px);
        min-width: 140px;
        max-width: none;
        text-align: center;
        padding: 14px 16px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    /* Hero section text alignment */
    .hero-section .banner-text-part-wraper {
        text-align: center;
        width: 100%;
    }
    
    .hero-section .main-title,
    .hero-section .subtitle-4 {
        text-align: center;
    }
    
    /* Banner form */
    .hero-section .banner-form {
        width: 100%;
        max-width: 100%;
    }
    
    .hero-section .banner-form-wraper {
        width: 100%;
        margin: 0 auto;
    }
    
    /* Multiple buttons in a row */
    .multiple_action_buttons_new {
        flex-wrap: wrap;
        gap: 8px !important;
    }
    
    .multiple_action_buttons_new .status-action-btn {
        flex: 1 1 auto;
        min-width: 80px;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    /* Cards */
    .service-card, .provider-card, .blog-card {
        margin-bottom: 20px;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 20px;
    }
    
    label {
        font-size: 14px;
        margin-bottom: 8px;
        display: block;
    }
    
    input.form-control, 
    textarea.form-control, 
    select.form-control,
    .form__control {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 14px 15px;
        width: 100%;
        border-radius: 8px;
    }
    
    textarea.form-control {
        min-height: 120px;
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
    }
    
    table {
        min-width: 600px;
        font-size: 13px;
    }
    
    table th,
    table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    /* Hide less important columns on mobile */
    .hide-mobile {
        display: none !important;
    }
    
    /* Status badges */
    .status-badge {
        font-size: 11px;
        padding: 4px 10px;
        white-space: nowrap;
    }
    
    /* Images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-content {
        border-radius: 12px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px 15px;
    }
    
    /* Trusted Clients Section */
    .truted-clients-section {
        padding-top: 40px;
        padding-bottom: 60px;
    }
    
    .trusted-clients-section-wraper {
        flex-direction: column;
        gap: 25px;
        text-align: center;
    }
    
    .trusted-clients-section-wraper .text-part {
        max-width: 100%;
        width: 100%;
        font-size: 1.125rem;
        line-height: 1.5;
        text-align: center;
        padding: 0 15px;
    }
    
    .client-slider-wraper {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .client-slider-item-wraper {
        animation: slide 20s linear infinite;
    }
    
    .client-slider-item-wraper .client-slider-item {
        padding: 0 25px;
        max-width: 180px;
    }
    
    .client-slider-item img {
        max-width: 100%;
        height: auto;
        opacity: 0.8;
    }
    
    /* Footer */
    .footer-widget {
        margin-bottom: 30px;
        text-align: center;
    }
    
    .footer-link-list {
        text-align: center;
    }
    
    .copyright-text {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: 14px;
        flex-wrap: wrap;
    }
    
    /* Search bars */
    .search-bar,
    .search-input {
        width: 100%;
        margin-bottom: 15px;
    }
    
    /* Filters */
    .filter-section {
        margin-bottom: 20px;
    }
    
    .filter-section select,
    .filter-section input {
        width: 100%;
        margin-bottom: 10px;
    }
    
    /* Grid layouts */
    .row.g-4 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1rem;
    }
    
    /* Sliders */
    .slider-btn {
        height: 35px;
        width: 35px;
        font-size: 16px;
    }
    
    /* Profile sections */
    .profile-image {
        max-width: 120px;
        margin: 0 auto 20px;
    }
    
    /* Dashboard cards */
    .dashboard-card {
        margin-bottom: 20px;
    }
    
    /* Tabs */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs .nav-link {
        white-space: nowrap;
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* Small Mobile (max-width: 575px) */
@media (max-width: 575px) {
    /* Even more compact */
    body {
        font-size: 13px;
    }
    
    h1, .main-title {
        font-size: 1.5rem !important;
    }
    
    h2, .title-2 {
        font-size: 1.25rem !important;
    }
    
    h3, .title-3 {
        font-size: 1.125rem !important;
    }
    
    /* Sections */
    .pat-120 {
        padding-top: 40px !important;
    }
    
    .pab-120 {
        padding-bottom: 40px !important;
    }
    
    /* Navigation - even more compact */
    .logo-wrapper {
        max-width: 130px;
        min-width: 80px;
        overflow: visible !important;
        height: 35px;
    }
    
    /* Override main CSS overflow: hidden */
    .navbar-brand {
        max-width: 130px !important;
        width: auto !important;
        height: 35px !important;
        overflow: visible !important; /* Override overflow: hidden from main CSS */
        display: flex !important;
        align-items: center;
    }
    
    .navbar-brand img,
    .logo-wrapper img {
        max-width: 130px !important;
        width: auto !important;
        height: 35px !important;
        max-height: 35px !important;
        object-fit: contain !important;
        object-position: left center !important;
        overflow: visible !important;
    }
    
    .navbar-toggler {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .responsive-mobile-menu .cmn-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .responsive-mobile-menu .provider-after-login-button,
    .user-avatar-fallback {
        width: 40px;
        height: 40px;
    }
    
    /* Buttons */
    .cmn-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* Hero section buttons - smaller screens */
    .banner-btn-wraper {
        max-width: 100%;
        gap: 10px !important;
    }
    
    .banner-btn-wraper .cmn-btn {
        flex: 1 1 calc(50% - 5px);
        min-width: 120px;
        padding: 12px 12px;
        font-size: 13px;
    }
    
    /* Action buttons */
    .multiple_action_buttons_new .status-action-btn {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    /* Tables */
    table {
        font-size: 12px;
    }
    
    table th,
    table td {
        padding: 8px 6px;
    }
    
    /* Modals */
    .modal-header h5,
    .modal-title {
        font-size: 18px;
    }
    
    /* Trusted Clients Section - Small Mobile */
    .truted-clients-section {
        padding-top: 30px;
        padding-bottom: 40px;
    }
    
    .trusted-clients-section-wraper .text-part {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .client-slider-item-wraper .client-slider-item {
        padding: 0 20px;
        max-width: 150px;
    }
}

/* Landscape orientation fixes */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar-collapse {
        max-height: 50vh;
    }
    
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Touch-specific improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets */
    a, button, input, select, textarea {
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .hover-effect:hover {
        transform: none !important;
    }
    
    /* Better focus states for touch */
    input:focus,
    textarea:focus,
    select:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Prevent text selection on buttons */
button, .cmn-btn, .status-action-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Fix for iOS Safari bottom bar */
@supports (-webkit-touch-callout: none) {
    .mobile-safe-area {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

