/* ===================================
   RESPONSIVE DESIGN FOR ALL PANELS
   =================================== */

/* ===================================
   GLOBAL RESPONSIVE BREAKPOINTS
   =================================== */
/* Extra Small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 0.625rem;
        padding-right: 0.625rem;
    }
    
    .card {
        margin-bottom: 0.9375rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    /* Sidebar mobile behavior - only for panels with sidebars */
    body:not([data-role="Client"]):not([data-role="Consultant"]) .sidebar-container {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        background: #fff;
        box-shadow: 0 0 0.625rem rgba(0,0,0,0.1);
    }
    
    body:not([data-role="Client"]):not([data-role="Consultant"]) .sidebar-container.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding-left: 0.9375rem !important;
        width: 100% !important;
    }
    
    /* Top navbar mobile adjustments */
    .top-navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1040;
/*        padding: 0.5rem 1rem;*/
    }
    
    .navbar-content {
        justify-content: space-between;
    }
    
    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--bs-primary);
    }
    
    .desktop-menu-toggle {
        display: none !important;
    }
    
    /* Notification dropdown mobile */
    .notification-dropdown {
        position: fixed !important;
        top: 3.75rem !important;
        left: 0.625rem !important;
        right: 0.625rem !important;
        width: auto !important;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    /* Profile dropdown mobile */
    .dropdown-menu {
        position: fixed !important;
        top: 3.75rem !important;
        left: 0.625rem !important;
        right: 0.625rem !important;
        width: auto !important;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container-fluid {
        padding-left: 0.9375rem;
        padding-right: 0.9375rem;
    }
    
    /* Sidebar mobile behavior - only for panels with sidebars */
    body:not([data-role="Client"]):not([data-role="Consultant"]) .sidebar-container {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        background: #fff;
        box-shadow: 0 0 0.625rem rgba(0,0,0,0.1);
    }
    
    body:not([data-role="Client"]):not([data-role="Consultant"]) .sidebar-container.show {
        left: 0;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding-left: 1.25rem !important;
        width: 100% !important;
    }
    
    .mobile-menu-toggle {
        display: block !important;
    }
    
    .desktop-menu-toggle {
        display: none !important;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Sidebar container width - only for panels with sidebars */
    body:not([data-role="Client"]):not([data-role="Consultant"]) .sidebar-container {
        width: 15.625rem;
    }
    
/*    .main-content {
        padding-left: 1.875rem !important;
    }*/
    
    /* Only apply sidebar margin to panels that have sidebars (Admin and SuperAdmin) */
    body:not([data-role="Client"]):not([data-role="Consultant"]) .main-content {
        margin-left: 15.625rem;
/*        margin-top:0px !important;
        padding:0px !important;*/
    }
    
               /* Collapsed sidebar width - only for panels with sidebars */
           body:not([data-role="Client"]):not([data-role="Consultant"]) .sidebar-collapsed .sidebar-container {
               width: 4.375rem;
           }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .desktop-menu-toggle {
        display: block !important;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .main-content {
/*        padding-left:5.5rem !important;*/
    }
    
    /* Only apply sidebar margin to panels that have sidebars (Admin and SuperAdmin) */
    body:not([data-role="Client"]):not([data-role="Consultant"]) .main-content {
/*        margin-left: 17.5rem;*/
    }
    
               /* Collapsed sidebar width - only for panels with sidebars */
           body:not([data-role="Client"]):not([data-role="Consultant"]) .sidebar-collapsed .sidebar-container {
               width: 5rem;
           }
    
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .desktop-menu-toggle {
        display: block !important;
    }
    
    /* Language switcher dropdown on large screens */
    .language-switcher .dropdown-menu {
        min-width: 12rem !important;
        font-size: 1rem !important;
    }
}

/* ===================================
   CLIENT PANEL RESPONSIVE
   =================================== */
@media (max-width: 767.98px) {
    /* Client Dashboard */
    .search-section {
        padding: 0.625rem 0;
    }
    
    .search-container {
        padding: 0 0.625rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control {
        border-radius: 0.375rem 0.375rem 0 0 !important;
        border-right: 1px solid #dee2e6 !important;
    }
    
    .input-group .btn {
        border-radius: 0 0 0.375rem 0.375rem !important;
        border-top: none !important;
    }
    
    /* Category navigation */
    .category-navigation-container {
        padding: 0.625rem 0 !important;
        margin-top: 0px !important;
    }
    
    .service-categories-wrapper {
        padding: 0 0.625rem;
    }
    
    .service-category-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }
    
    /* Featured consultants */
    .section-title {
        font-size: 1.5rem;
    }
    
    .consultant-card {
        margin-bottom: 0.9375rem;
    }
    
    .consultant-card .card-body {
        padding: 0.9375rem;
    }
    
    .consultant-info {
        flex-direction: column;
        text-align: center;
    }
    
    .consultant-avatar {
        margin-bottom: 0.625rem;
    }
    
    /* Search results */
    .search-results {
        padding: 0 0.625rem;
    }
    
    .filter-sidebar {
        order: 2;
        margin-top: 1.25rem;
    }
    
    .results-main {
        order: 1;
    }
    
    /* Client Top Navbar Mobile Optimizations */
    body[data-role="Client"] .top-navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1040;
        background: #fff;
        box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
        padding: 0.5rem 0;
        min-height: 3.5rem;
    }
    
    body[data-role="Client"] .navbar-content {
        flex-wrap: nowrap;
        gap: 0.5rem;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 0 0.5rem;
    }
    
    /* Logo sizing for mobile */
    body[data-role="Client"] .logo-mini-wrapper {
        margin-right: 0.5rem !important;
        flex-shrink: 0;
    }
    
    body[data-role="Client"] .logo-image {
        height: 1.75rem;
        width: auto;
        flex-shrink: 0;
    }
    
    /* Navigation links for authenticated users - hide on mobile, show in hamburger */
    body[data-role="Client"] .navbar-nav.flex-row:not(.align-items-center) {
        display: none !important;
    }
    
    /* Right section - keep compact */
/*    body[data-role="Client"] .navbar-nav.align-items-center {
        gap: 0.375rem !important;
        display: flex !important;
        flex-direction: row;
        align-items: center;
        margin-left: auto;
        flex-shrink: 0;
    }*/
    
    /* Ensure right bar elements are visible on mobile */
    body[data-role="Client"] .navbar-nav.align-items-center .nav-item {
        display: flex !important;
        align-items: center;
        flex-shrink: 0;
        min-width: 0;
        max-width: none;
    }
    
    /* Language switcher mobile optimization */
    body[data-role="Client"] .language-switcher {
        font-size: 0.875rem;
        display: block !important;
        position: relative;
    }
    
    /* Hide language switcher on mobile for unauthenticated users */
    body[data-role="Client"]:not(.authenticated) .language-switcher {
            display: none !important;
    }
    
    /* Authentication buttons mobile optimization */
    body[data-role="Client"] .auth-btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
        white-space: nowrap;
        display: inline-flex !important;
        align-items: center;
        text-decoration: none;
    }
    
    body[data-role="Client"] .signin-btn {
        padding: 0.375rem 0.625rem !important;
    }
    
    body[data-role="Client"] .join-btn {
        padding: 0.375rem 0.75rem !important;
    }
    
    /* Buy Subscription link mobile optimization */
    body[data-role="Client"] .gradient-text {
        font-size: 0.875rem;
        white-space: nowrap;
        display: inline-block !important;
        text-decoration: none;
    }
    
    /* Ensure unauthenticated navbar stays in one row */
    body[data-role="Client"]:not(.authenticated) .navbar-content {
        flex-wrap: nowrap !important;
        gap: 0.25rem !important;
        padding: 0.5rem;
    }
    
    body[data-role="Client"]:not(.authenticated) .navbar-nav.align-items-center {
        gap: 0.25rem !important;
        flex-shrink: 0;
    }
    
    body[data-role="Client"]:not(.authenticated) .nav-item {
        flex-shrink: 0;
    }
    
    /* Optimize button sizes for mobile */
    body[data-role="Client"]:not(.authenticated) .auth-btn {
        font-size: 0.8rem !important;
        padding: 0.25rem 0.5rem !important;
        white-space: nowrap;
    }
    
    body[data-role="Client"]:not(.authenticated) .signin-btn {
        padding: 0.25rem 0.5rem !important;
    }
    
    body[data-role="Client"]:not(.authenticated) .join-btn {
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Handle very small screens */
    @media (max-width: 360px) {
        body[data-role="Client"]:not(.authenticated) .gradient-text {
            display: none;
        }
        
        body[data-role="Client"]:not(.authenticated) .auth-btn {
            font-size: 0.75rem !important;
            padding: 0.25rem 0.375rem !important;
        }
        
        body[data-role="Client"]:not(.authenticated) .signin-btn {
            padding: 0.25rem 0.375rem !important;
        }
        
        body[data-role="Client"]:not(.authenticated) .join-btn {
            padding: 0.25rem 0.375rem !important;
        }
        
        body[data-role="Client"]:not(.authenticated) .logo-image {
            height: 1.5rem;
        }
        
        body[data-role="Client"]:not(.authenticated) .logo-mini-wrapper {
            margin-right: 0.375rem !important;
        }
    }
    
    /* Profile dropdown mobile optimization */
    body[data-role="Client"] .w-60px.h-60px {
        width: 2.5rem !important;
        height: 2.5rem !important;
    }
    
    /* Notification bell mobile optimization */
    body[data-role="Client"] .fa.fa-bell {
        font-size: 1.25rem !important;
    }
    
    /* Mobile hamburger menu for authenticated users */
    body[data-role="Client"] .mobile-hamburger-menu {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--bs-primary);
        padding: 0.375rem;
        cursor: pointer;
        margin-right: 0.5rem !important;
        flex-shrink: 0 !important;
    }
    
    /* Hide desktop sidebar toggler on mobile */
    body[data-role="Client"] .sidebar-toggler:not(.mobile-hamburger-menu) {
        display: none !important;
    }
    
    /* Ensure main content doesn't overlap with fixed navbar */
    body[data-role="Client"] .main-content {
        margin-top: 4rem !important;
    }
    
    /* Authenticated user navbar mobile optimization */
    body[data-role="Client"].authenticated .navbar-content {
        gap: 0.375rem !important;
    }
    
    body[data-role="Client"].authenticated .navbar-nav.align-items-center {
        gap: 0.375rem !important;
    }
    
    /* Profile and notification sizing for mobile */
    body[data-role="Client"].authenticated .w-60px.h-60px {
        width: 2.25rem !important;
        height: 2.25rem !important;
    }
    
    body[data-role="Client"].authenticated .fa.fa-bell {
        font-size: 1.125rem !important;
    }
    
    body[data-role="Client"].authenticated .sidebar-toggler {
        font-size: 1.125rem;
        padding: 0.25rem;
    }
    
    /* Mobile optimization for authenticated users */
        body[data-role="Client"].authenticated .navbar-nav.flex-row:not(.align-items-center) {
            display: none !important;
        }
        
        body[data-role="Client"].authenticated .navbar-nav.align-items-center {
            display: flex !important;
        }
        
        body[data-role="Client"].authenticated .mobile-hamburger-menu {
            display: block !important;
        }
        
        body[data-role="Client"].authenticated .navbar-content {
            justify-content: space-between !important;
            gap: 0.25rem !important;
        }
        
        body[data-role="Client"].authenticated .navbar-content > div:first-child {
            display: flex !important;
            align-items: center !important;
            gap: 0.5rem !important;
        }
        
        body[data-role="Client"].authenticated .navbar-content > ul:last-child {
            gap: 0.25rem !important;
            flex-shrink: 0 !important;
        }
        
        body[data-role="Client"].authenticated .language-switcher {
            display: block !important;
        }
        
        body[data-role="Client"].authenticated .language-switcher .btn-link {
            font-size: 0.75rem !important;
            padding: 0.25rem 0.5rem !important;
            min-height: 2rem !important;
    }
    
    /* Client Mobile Menu Overlay */
    .client-mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1060;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
        visibility: hidden;
    }
    
    .client-mobile-menu-overlay.show {
        display: block;
        opacity: 1;
        visibility: visible;
    }
    
    .client-mobile-menu-content {
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 20rem;
        height: 100%;
        background: #fff;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 1071;
        box-shadow: 0 0 1rem rgba(0, 0, 0, 0.3);
    }
    
    .client-mobile-menu-overlay.show .client-mobile-menu-content {
        transform: translateX(0);
    }
    
    .client-mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem;
        border-bottom: 1px solid #e9ecef;
        background: var(--bs-primary);
        color: #fff;
    }
    
    .client-mobile-menu-header h5 {
        margin: 0;
        font-size: 1.125rem;
    }
    
    .client-mobile-menu-header .btn-close {
        background: none;
        border: none;
        color: #fff;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0;
        width: 1.5rem;
        height: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .client-mobile-menu-nav {
        padding: 1rem 0;
    }
    
    .client-mobile-menu-nav ul {
        margin: 0;
        padding: 0;
    }
    
    .client-mobile-menu-nav li {
        border-bottom: 1px solid #f8f9fa;
    }
    
    .mobile-menu-link {
        display: flex;
        align-items: center;
        padding: 1rem;
        color: #495057;
        text-decoration: none;
        transition: background-color 0.2s ease;
    }
    
    .mobile-menu-link:hover {
        background-color: #f8f9fa;
        color: var(--bs-primary);
    }
    
    .mobile-menu-icon {
        width: 1.25rem;
        height: 1.25rem;
        margin-right: 0.75rem;
        color: var(--bs-primary);
    }
    
    .mobile-menu-link span {
        font-size: 1rem;
        font-weight: 500;
    }
    
    .mobile-menu-link:active {
        background-color: #e9ecef !important;
        color: var(--bs-primary) !important;
    }
    
    /* Hide mobile menu on larger screens */
    @media (min-width: 768px) {
        .client-mobile-menu-overlay,
        .client-mobile-menu-content,
        .mobile-menu-link,
        .mobile-menu-nav,
        .client-mobile-menu-nav,
        body[data-role="Client"] .mobile-hamburger-menu {
            display: none !important;
        }
    }
}

/* ===================================
   CONSULTANT PANEL RESPONSIVE
   =================================== */
@media (max-width: 767.98px) {
    /* Consultant Dashboard */
    .consultant-page .top-navbar {
        width: 100%;
        left: 0;
    }
    
    /* Statistics cards */
    .col-lg-3.col-md-6 {
        margin-bottom: 15px;
    }
    
    .card .card-body {
        padding: 15px;
    }
    
    .card h3 {
        font-size: 1.5rem;
    }
    
    .card p {
        font-size: 0.875rem;
    }
    
    /* Profile section */
    .col-lg-4 {
        margin-bottom: 2px;
    }
    
    .profile-card img {
        width: 80px;
        height: 80px;
    }
    
    /* Appointments table */
    .appointments-table {
        font-size: 0.875rem;
    }
    
    .appointments-table th,
    .appointments-table td {
        padding: 8px 4px;
    }
    
    /* Service management */
    .service-card {
        margin-bottom: 15px;
    }
    
    .service-form {
        padding: 15px;
    }
}

/* ===================================
   COMPANY ADMIN PANEL RESPONSIVE
   =================================== */

/* Mobile and tablet adjustments for User Management */
@media (max-width: 767.98px) {
    /* Table responsive adjustments */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #usermanagementtable {
        min-width: 600px; /* Ensure minimum width for scrolling */
    }
    
    /* Consultant info layout for mobile */
    .consultant-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 5px;
    }
    
    .profile-img {
        width: 35px !important;
        height: 35px !important;
        margin-bottom: 3px;
    }
    
    .consultant-name {
        font-size: 0.875rem;
        word-break: break-word;
    }
    
    /* Action buttons for mobile */
    .btn-icon {
        padding: 4px;
        margin: 1px;
        font-size: 0.875rem;
    }
    
    /* Page header for mobile */
    .d-flex.justify-content-between.align-items-center {
/*        flex-direction: column;*/
        gap: 10px;
        align-items: stretch !important;
    }
    
    .consultant-title {
        font-size: 1.2rem;
        text-align: center;
    }
    
    /* Add Consultant button for mobile */
    .btn-primary {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        
    }
    
    /* Modals for mobile */
    .modal-dialog {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .modal-body {
        padding: 15px;
    }
    
    /* Form layout for mobile */
    .row.mb-3 .col-md-6 {
        margin-bottom: 15px;
    }
    
    .form-control {
        font-size: 0.875rem;
    }
    
    /* Profile picture edit container for mobile */
    .profile-picture-edit-container {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .profile-picture-preview {
        margin-bottom: 15px;
        margin-right: 0 !important;
    }
    
    .profile-picture-preview img {
        width: 100px !important;
        height: 100px !important;
    }
}

/* Tablet specific adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Table responsive adjustments */
    .table-responsive {
        overflow-x: auto;
    }
    
    #usermanagementtable {
        min-width: 700px;
    }
    
    /* Consultant info layout for tablet */
    .consultant-info {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .profile-img {
        width: 40px !important;
        height: 40px !important;
        margin-bottom: 0;
    }
    
    .consultant-name {
        font-size: 0.9rem;
    }
    
    /* Action buttons for tablet */
    .btn-icon {
        padding: 5px;
        margin: 2px;
        font-size: 0.9rem;
    }
    
    /* Page header for tablet */
    .d-flex.justify-content-between.align-items-center {
        flex-direction: row;
        align-items: center !important;
    }
    
    .consultant-title {
        font-size: 1.3rem;
        text-align: left;
    }
    
    /* Add Consultant button for tablet */
    .btn-primary {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        width: auto;
    }
    
    /* Modals for tablet */
    .modal-dialog {
        margin: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    /* Form layout for tablet */
    .row.mb-3 .col-md-6 {
        margin-bottom: 20px;
    }
    
    .form-control {
        font-size: 0.9rem;
    }
    
    /* Profile picture edit container for tablet */
    .profile-picture-edit-container {
        flex-direction: row;
        text-align: left;
        padding: 20px;
    }
    
    .profile-picture-preview {
        margin-bottom: 0;
        margin-right: 1.5rem !important;
    }
    
    .profile-picture-preview img {
        width: 120px !important;
        height: 120px !important;
    }
    
    /* Client Top Navbar Tablet Optimizations */
    body[data-role="Client"] .top-navbar {
        padding: 0.625rem 1rem;
    }
    
    body[data-role="Client"] .logo-image {
        height: 2.25rem;
    }
    
    body[data-role="Client"] .navbar-nav.align-items-center {
        gap: 0.5rem;
    }
    
    body[data-role="Client"] .auth-btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    body[data-role="Client"] .gradient-text {
        font-size: 0.9rem;
    }
    
    /* Language switcher dropdown on tablet */
    .language-switcher .dropdown-menu {
        min-width: 11rem !important;
        font-size: 0.9rem !important;
    }
}

/* ===================================
   COMPANY ADMIN TOP NAVBAR RESPONSIVE
   =================================== */

/* Mobile adjustments for top navbar elements */
@media (max-width: 767.98px) {
    /* Language switcher */
    .navbar-nav .nav-item:first-child {
        margin-right: 10px;
    }
    
    /* Notification bell */
    .navbar-nav .nav-item:nth-child(2) {
        margin-right: 10px;
    }
    
    /* Profile dropdown */
    .navbar-nav .nav-item:last-child {
        margin-right: 10px;
    }
    
    /* Profile image size */
    .w-60px.h-60px {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* Notification badge */
    .notification-badge {
        font-size: 0.7rem;
        padding: 2px 4px;
        min-width: 16px;
        height: 16px;
    }
    
    /* Dropdown menus */
    .dropdown-menu {
        font-size: 0.875rem;
    }
    
    .dropdown-item {
        padding: 8px 15px;
    }
    
    /* Notification dropdown */
    .notification-dropdown {
        max-width: 300px;
        max-height: 60vh;
    }
    
    .notification-header h6 {
        font-size: 0.875rem;
    }
    
    .notification-footer a {
        font-size: 0.8rem;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Profile image size */
    .w-60px.h-60px {
        width: 50px !important;
        height: 50px !important;
    }
    
    /* Notification badge */
    .notification-badge {
        font-size: 0.8rem;
        padding: 3px 6px;
        min-width: 18px;
        height: 18px;
    }
    
    /* Dropdown menus */
    .dropdown-menu {
        font-size: 0.9rem;
    }
    
    .dropdown-item {
        padding: 10px 20px;
    }
    
    /* Notification dropdown */
    .notification-dropdown {
        max-width: 350px;
        max-height: 70vh;
    }
}

/* Desktop adjustments */
@media (min-width: 992px) {
    /* Profile image size */
    .w-60px.h-60px {
        width: 60px !important;
        height: 60px !important;
    }
    
    /* Dropdown menus */
    .dropdown-menu {
        font-size: 1rem;
    }
    
    .dropdown-item {
        padding: 12px 25px;
    }
    
    /* Notification dropdown */
    .notification-dropdown {
        max-width: 400px;
        max-height: 80vh;
    }
}

/* ===================================
   SUPER ADMIN PANEL RESPONSIVE
   =================================== */
@media (max-width: 767.98px) {
    /* Super Admin tables */
    #usersTable,
    #categoriesTable,
    #companiesTable,
    #subscriptionPlansTable {
        font-size: 0.875rem;
    }
    
    #usersTable th,
    #usersTable td,
    #categoriesTable th,
    #categoriesTable td,
    #companiesTable th,
    #companiesTable td,
    #subscriptionPlansTable th,
    #subscriptionPlansTable td {
        padding: 8px 4px;
    }
    
    /* Financial reporting */
    .financial-card {
        margin-bottom: 15px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    /* Payment settings */
    .payment-settings-form {
        padding: 15px;
    }
    
    .settings-card {
        margin-bottom: 15px;
    }
    
    /* Connect monitoring */
    .monitoring-card {
        margin-bottom: 15px;
    }
    
    .status-indicator {
        font-size: 0.875rem;
    }
}

/* ===================================
   COMMON COMPONENTS RESPONSIVE
   =================================== */
@media (max-width: 767.98px) {
    /* Breadcrumbs */
    .breadcrumb {
        font-size: 0.875rem;
        padding: 0.5rem 0;
    }
    
    .breadcrumb-item {
        margin-right: 0.3125rem;
    }
    
    /* Page headers */
    .page-header {
        padding: 0.9375rem 0;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    /* Cards */
    .card-header {
        padding: 0.9375rem;
    }
    
    .card-body {
        padding: 0.9375rem;
    }
    
    .card-footer {
        padding: 0.9375rem;
    }
    
    /* Forms */
    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.3125rem;
    }
    
    .form-control {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    .form-select {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Buttons */
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.3125rem;
    }
    
    /* Badges */
    .badge {
        font-size: 0.75rem;
    }
    
    /* Alerts */
    .alert {
        padding: 0.625rem 0.9375rem;
        font-size: 0.875rem;
    }
    
    /* Modals */
    .modal-header {
        padding: 0.9375rem;
    }
    
    .modal-body {
        padding: 0.9375rem;
    }
    
    .modal-footer {
        padding: 0.9375rem;
    }
    
    /* Dropdowns */
    .dropdown-menu {
        font-size: 0.875rem;
    }
    
    .dropdown-item {
        padding: 0.5rem 0.9375rem;
    }
    
    /* Tables */
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Pagination */
    .pagination {
        font-size: 0.875rem;
    }
    
    .page-link {
        padding: 0.375rem 0.75rem;
    }
}

/* ===================================
   TABLET SPECIFIC ADJUSTMENTS
   =================================== */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container-fluid {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn {
        font-size: 0.9rem;
    }
    
    .form-control {
        font-size: 0.9rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
}

/* ===================================
   LARGE SCREEN OPTIMIZATIONS
   =================================== */
@media (min-width: 1200px) {
    .card {
        margin-bottom: 1.5625rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .table {
        font-size: 1rem;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    .sidebar-container,
    .top-navbar,
    .breadcrumb,
    .btn,
    .modal,
    .dropdown-menu {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding-left: 0 !important;
        width: 100% !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .table {
        border-collapse: collapse;
    }
    
    .table th,
    .table td {
        border: 1px solid #000;
    }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (prefers-color-scheme: dark) {
    /* Dark mode support can be added here */
}

/* ===================================
   HIGH CONTRAST MODE
   =================================== */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .form-control {
        border: 2px solid #000;
    }
}

/* ===================================
   LANDSCAPE ORIENTATION
   =================================== */
@media (orientation: landscape) and (max-height: 500px) {
    .sidebar-container {
        overflow-y: auto;
    }
    
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .notification-dropdown {
        max-height: 60vh;
    }
}

/* ===================================
   UTILITY CLASSES FOR RESPONSIVE
   =================================== */
.d-none-mobile {
    display: none !important;
}

@media (min-width: 768px) {
    .d-none-mobile {
        display: none !important;
    }
    
    .d-block-mobile {
        display: none !important;
    }
}

.d-block-mobile {
    display: block !important;
}

@media (min-width: 768px) {
    .d-block-mobile {
        display: none !important;
    }
}

/* Text size utilities */
.text-responsive-sm {
    font-size: 0.875rem;
}

@media (min-width: 768px) {
    .text-responsive-sm {
        font-size: 1rem;
    }
}

.text-responsive-lg {
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    .text-responsive-lg {
        font-size: 1.5rem;
    }
}

/* Spacing utilities */
.p-responsive {
    padding: 0.375rem; /* Minimal padding on mobile (6px) for max content */
}

@media (min-width: 576px) {
    .p-responsive {
        padding: 0.5rem; /* Slightly more on larger phones (8px) */
    }
}

@media (min-width: 768px) {
    .p-responsive {
        padding: 0.75rem; /* Tablet padding (12px) */
    }
}

@media (min-width: 992px) {
    .p-responsive {
        padding: 1rem; /* Desktop padding (16px) */
    }
}

.m-responsive {
    margin: 0.625rem;
}

@media (min-width: 768px) {
    .m-responsive {
        margin: 1.25rem;
    }
} 
