/* ============================================
   RESPONSIVE UTILITY CLASSES FOR ALL SCREEN SIZES
   ============================================ */

/* These utility classes help make the site more responsive across all devices */

/* ========= TABLET UTILITIES (768px and below) ========= */
@media screen and (max-width: 768px) {
    
    /* Text Utilities */
    .text-md-center { text-align: center !important; }
    .text-md-left { text-align: left !important; }
    .text-md-right { text-align: right !important; }
    
    /* Font Size Utilities */
    .fs-md-14 { font-size: 14px !important; }
    .fs-md-16 { font-size: 16px !important; }
    .fs-md-18 { font-size: 18px !important; }
    .fs-md-20 { font-size: 20px !important; }
    .fs-md-24 { font-size: 24px !important; }
    
    /* Display Utilities */
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    
    /* Flex Utilities */
    .flex-md-column { flex-direction: column !important; }
    .flex-md-row { flex-direction: row !important; }
    .justify-content-md-center { justify-content: center !important; }
    .align-items-md-center { align-items: center !important; }
    
    /* Width Utilities */
    .w-md-100 { width: 100% !important; }
    .w-md-75 { width: 75% !important; }
    .w-md-50 { width: 50% !important; }
    
    /* Spacing Utilities */
    .p-md-3 { padding: 1rem !important; }
    .p-md-4 { padding: 1.5rem !important; }
    .m-md-3 { margin: 1rem !important; }
    .m-md-4 { margin: 1.5rem !important; }
    
    /* Custom tablet helpers */
    .tablet-stack > * {
        width: 100% !important;
        margin-bottom: 15px !important;
    }
    
    .tablet-center {
        text-align: center !important;
        margin: 0 auto !important;
    }
    
    .tablet-hide { display: none !important; }
}

/* ========= MOBILE UTILITIES (576px and below) ========= */
@media screen and (max-width: 576px) {
    
    /* Text Utilities */
    .text-sm-center { text-align: center !important; }
    .text-sm-left { text-align: left !important; }
    .text-sm-right { text-align: right !important; }
    
    /* Font Size Utilities */
    .fs-sm-12 { font-size: 12px !important; }
    .fs-sm-13 { font-size: 13px !important; }
    .fs-sm-14 { font-size: 14px !important; }
    .fs-sm-16 { font-size: 16px !important; }
    .fs-sm-18 { font-size: 18px !important; }
    
    /* Display Utilities */
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
    
    /* Flex Utilities */
    .flex-sm-column { flex-direction: column !important; }
    .flex-sm-wrap { flex-wrap: wrap !important; }
    .justify-content-sm-center { justify-content: center !important; }
    .align-items-sm-center { align-items: center !important; }
    
    /* Width Utilities */
    .w-sm-100 { width: 100% !important; }
    .w-sm-auto { width: auto !important; }
    
    /* Spacing Utilities */
    .p-sm-2 { padding: 0.5rem !important; }
    .p-sm-3 { padding: 1rem !important; }
    .m-sm-2 { margin: 0.5rem !important; }
    .m-sm-3 { margin: 1rem !important; }
    .mx-sm-auto { margin-left: auto !important; margin-right: auto !important; }
    
    /* Custom mobile helpers */
    .mobile-stack > * {
        width: 100% !important;
        margin-bottom: 12px !important;
    }
    
    .mobile-center {
        text-align: center !important;
        margin: 0 auto !important;
        display: block !important;
    }
    
    .mobile-hide { display: none !important; }
    
    .mobile-btn {
        width: 100% !important;
        margin-bottom: 10px !important;
        padding: 10px 15px !important;
    }
}

/* ========= SMALL MOBILE UTILITIES (480px and below) ========= */
@media screen and (max-width: 480px) {
    
    /* Text Utilities */
    .text-xs-center { text-align: center !important; }
    .text-xs-left { text-align: left !important; }
    .text-xs-right { text-align: right !important; }
    
    /* Font Size Utilities */
    .fs-xs-11 { font-size: 11px !important; }
    .fs-xs-12 { font-size: 12px !important; }
    .fs-xs-13 { font-size: 13px !important; }
    .fs-xs-14 { font-size: 14px !important; }
    
    /* Display Utilities */
    .d-xs-none { display: none !important; }
    .d-xs-block { display: block !important; }
    .d-xs-flex { display: flex !important; }
    
    /* Width Utilities */
    .w-xs-100 { width: 100% !important; }
    
    /* Spacing Utilities */
    .p-xs-1 { padding: 0.25rem !important; }
    .p-xs-2 { padding: 0.5rem !important; }
    .m-xs-1 { margin: 0.25rem !important; }
    .m-xs-2 { margin: 0.5rem !important; }
    
    /* Custom small mobile helpers */
    .xs-compact {
        padding: 8px !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
    }
    
    .xs-btn {
        width: 100% !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        margin-bottom: 8px !important;
    }
}

/* ========= HEADER POSITIONING UTILITIES (381px and below) ========= */
@media screen and (max-width: 381px) {
    
    /* Header layout utilities to prevent hamburger shifting */
    .navbar-fixed-layout {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }
    
    .brand-compact {
        width: 125px !important;
        flex-shrink: 0 !important;
        margin-right: auto !important;
    }
    
    .toggler-right {
        flex-shrink: 0 !important;
        margin-left: auto !important;
        order: 2 !important;
        padding: 6px 8px !important;
    }
    
    .container-header-fix {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    /* Spacing utilities for this range */
    .navbar-spacing-381 {
        padding: 8px 0 !important;
    }
    
    .container-381 {
        max-width: 360px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* ========= ULTRA SMALL UTILITIES (330px and below) ========= */
@media screen and (max-width: 330px) {
    
    /* Text Utilities */
    .text-xs-center { text-align: center !important; }
    .text-xs-left { text-align: left !important; }
    .text-xs-right { text-align: right !important; }
    
    /* Font Size Utilities */
    .fs-xs-10 { font-size: 10px !important; }
    .fs-xs-11 { font-size: 11px !important; }
    .fs-xs-12 { font-size: 12px !important; }
    .fs-xs-13 { font-size: 13px !important; }
    .fs-xs-14 { font-size: 14px !important; }
    
    /* Display Utilities */
    .d-xs-none { display: none !important; }
    .d-xs-block { display: block !important; }
    .d-xs-inline { display: inline !important; }
    .d-xs-inline-block { display: inline-block !important; }
    .d-xs-flex { display: flex !important; }
    
    /* Flex Utilities */
    .flex-xs-column { flex-direction: column !important; }
    .flex-xs-row { flex-direction: row !important; }
    .justify-content-xs-center { justify-content: center !important; }
    .justify-content-xs-start { justify-content: flex-start !important; }
    .justify-content-xs-end { justify-content: flex-end !important; }
    .align-items-xs-center { align-items: center !important; }
    .align-items-xs-start { align-items: flex-start !important; }
    .align-items-xs-end { align-items: flex-end !important; }
    
    /* Width Utilities */
    .w-xs-25 { width: 25% !important; }
    .w-xs-50 { width: 50% !important; }
    .w-xs-75 { width: 75% !important; }
    .w-xs-100 { width: 100% !important; }
    .w-xs-auto { width: auto !important; }
    
    /* Margin Utilities */
    .m-xs-0 { margin: 0 !important; }
    .m-xs-1 { margin: 5px !important; }
    .m-xs-2 { margin: 10px !important; }
    .m-xs-3 { margin: 15px !important; }
    .m-xs-auto { margin: auto !important; }
    
    .mt-xs-0 { margin-top: 0 !important; }
    .mt-xs-1 { margin-top: 5px !important; }
    .mt-xs-2 { margin-top: 10px !important; }
    .mt-xs-3 { margin-top: 15px !important; }
    
    .mb-xs-0 { margin-bottom: 0 !important; }
    .mb-xs-1 { margin-bottom: 5px !important; }
    .mb-xs-2 { margin-bottom: 10px !important; }
    .mb-xs-3 { margin-bottom: 15px !important; }
    
    .ml-xs-0, .ms-xs-0 { margin-left: 0 !important; }
    .ml-xs-1, .ms-xs-1 { margin-left: 5px !important; }
    .ml-xs-2, .ms-xs-2 { margin-left: 10px !important; }
    .ml-xs-3, .ms-xs-3 { margin-left: 15px !important; }
    
    .mr-xs-0, .me-xs-0 { margin-right: 0 !important; }
    .mr-xs-1, .me-xs-1 { margin-right: 5px !important; }
    .mr-xs-2, .me-xs-2 { margin-right: 10px !important; }
    .mr-xs-3, .me-xs-3 { margin-right: 15px !important; }
    
    .mx-xs-0 { margin-left: 0 !important; margin-right: 0 !important; }
    .mx-xs-1 { margin-left: 5px !important; margin-right: 5px !important; }
    .mx-xs-2 { margin-left: 10px !important; margin-right: 10px !important; }
    .mx-xs-3 { margin-left: 15px !important; margin-right: 15px !important; }
    .mx-xs-auto { margin-left: auto !important; margin-right: auto !important; }
    
    .my-xs-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
    .my-xs-1 { margin-top: 5px !important; margin-bottom: 5px !important; }
    .my-xs-2 { margin-top: 10px !important; margin-bottom: 10px !important; }
    .my-xs-3 { margin-top: 15px !important; margin-bottom: 15px !important; }
    
    /* Padding Utilities */
    .p-xs-0 { padding: 0 !important; }
    .p-xs-1 { padding: 5px !important; }
    .p-xs-2 { padding: 10px !important; }
    .p-xs-3 { padding: 15px !important; }
    
    .pt-xs-0 { padding-top: 0 !important; }
    .pt-xs-1 { padding-top: 5px !important; }
    .pt-xs-2 { padding-top: 10px !important; }
    .pt-xs-3 { padding-top: 15px !important; }
    
    .pb-xs-0 { padding-bottom: 0 !important; }
    .pb-xs-1 { padding-bottom: 5px !important; }
    .pb-xs-2 { padding-bottom: 10px !important; }
    .pb-xs-3 { padding-bottom: 15px !important; }
    
    .pl-xs-0, .ps-xs-0 { padding-left: 0 !important; }
    .pl-xs-1, .ps-xs-1 { padding-left: 5px !important; }
    .pl-xs-2, .ps-xs-2 { padding-left: 10px !important; }
    .pl-xs-3, .ps-xs-3 { padding-left: 15px !important; }
    
    .pr-xs-0, .pe-xs-0 { padding-right: 0 !important; }
    .pr-xs-1, .pe-xs-1 { padding-right: 5px !important; }
    .pr-xs-2, .pe-xs-2 { padding-right: 10px !important; }
    .pr-xs-3, .pe-xs-3 { padding-right: 15px !important; }
    
    .px-xs-0 { padding-left: 0 !important; padding-right: 0 !important; }
    .px-xs-1 { padding-left: 5px !important; padding-right: 5px !important; }
    .px-xs-2 { padding-left: 10px !important; padding-right: 10px !important; }
    .px-xs-3 { padding-left: 15px !important; padding-right: 15px !important; }
    
    .py-xs-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
    .py-xs-1 { padding-top: 5px !important; padding-bottom: 5px !important; }
    .py-xs-2 { padding-top: 10px !important; padding-bottom: 10px !important; }
    .py-xs-3 { padding-top: 15px !important; padding-bottom: 15px !important; }
    
    /* Border Utilities */
    .border-xs-0 { border: 0 !important; }
    .border-xs { border: 1px solid #dee2e6 !important; }
    .border-top-xs { border-top: 1px solid #dee2e6 !important; }
    .border-bottom-xs { border-bottom: 1px solid #dee2e6 !important; }
    .border-left-xs { border-left: 1px solid #dee2e6 !important; }
    .border-right-xs { border-right: 1px solid #dee2e6 !important; }
    
    /* Border Radius */
    .rounded-xs { border-radius: 5px !important; }
    .rounded-xs-0 { border-radius: 0 !important; }
    .rounded-xs-circle { border-radius: 50% !important; }
    .rounded-xs-pill { border-radius: 50rem !important; }
    
    /* Shadow Utilities */
    .shadow-xs-none { box-shadow: none !important; }
    .shadow-xs-sm { box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075) !important; }
    .shadow-xs { box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important; }
    
    /* Position Utilities */
    .position-xs-static { position: static !important; }
    .position-xs-relative { position: relative !important; }
    .position-xs-absolute { position: absolute !important; }
    .position-xs-fixed { position: fixed !important; }
    .position-xs-sticky { position: sticky !important; }
    
    /* Overflow Utilities */
    .overflow-xs-auto { overflow: auto !important; }
    .overflow-xs-hidden { overflow: hidden !important; }
    .overflow-xs-visible { overflow: visible !important; }
    .overflow-xs-scroll { overflow: scroll !important; }
    
    /* Z-index Utilities */
    .z-xs-n1 { z-index: -1 !important; }
    .z-xs-0 { z-index: 0 !important; }
    .z-xs-1 { z-index: 1 !important; }
    .z-xs-2 { z-index: 2 !important; }
    .z-xs-3 { z-index: 3 !important; }
    
    /* Gap Utilities for Flexbox */
    .gap-xs-0 { gap: 0 !important; }
    .gap-xs-1 { gap: 5px !important; }
    .gap-xs-2 { gap: 10px !important; }
    .gap-xs-3 { gap: 15px !important; }
    
    /* Custom Mobile Helpers */
    .hide-decorations {
        background-image: none !important;
        box-shadow: none !important;
    }
    
    .mobile-stack > * {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    .mobile-stack > *:last-child {
        margin-bottom: 0 !important;
    }
    
    .mobile-center-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    .mobile-full-width {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    .mobile-compact {
        padding: 8px !important;
        margin: 4px 0 !important;
        font-size: 12px !important;
        line-height: 1.3 !important;
    }
    
    .mobile-hide-overflow {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    .mobile-wrap-text {
        white-space: normal !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Button Adaptations */
    .btn-xs-sm {
        padding: 6px 12px !important;
        font-size: 11px !important;
        line-height: 1.3 !important;
        border-radius: 3px !important;
    }
    
    .btn-xs-block {
        display: block !important;
        width: 100% !important;
        margin: 5px 0 !important;
    }
    
    /* Form Adaptations */
    .form-xs-compact .form-control {
        padding: 6px 8px !important;
        font-size: 12px !important;
        height: auto !important;
    }
    
    .form-xs-compact .form-label {
        font-size: 11px !important;
        margin-bottom: 3px !important;
    }
    
    /* Card Adaptations */
    .card-xs-compact {
        border-radius: 5px !important;
    }
    
    .card-xs-compact .card-header {
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
    
    .card-xs-compact .card-body {
        padding: 10px !important;
    }
    
    .card-xs-compact .card-footer {
        padding: 8px 10px !important;
        font-size: 11px !important;
    }
    
    /* Table Adaptations */
    .table-xs-responsive {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .table-xs-compact {
        font-size: 10px !important;
    }
    
    .table-xs-compact th,
    .table-xs-compact td {
        padding: 3px 5px !important;
        vertical-align: top !important;
    }
    
    /* List Adaptations */
    .list-xs-compact .list-group-item {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }
    
    /* Navigation Adaptations */
    .nav-xs-stack .nav-item {
        width: 100% !important;
        margin-bottom: 2px !important;
    }
    
    .nav-xs-stack .nav-link {
        text-align: center !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
    }
    
    /* Image Adaptations */
    .img-xs-responsive {
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
        margin: 0 auto !important;
    }
    
    .img-xs-small {
        max-width: 50px !important;
        max-height: 50px !important;
    }
    
    .img-xs-medium {
        max-width: 80px !important;
        max-height: 80px !important;
    }
    
    /* Animation Performance Optimizations */
    .reduce-motion {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
    
    .no-motion {
        animation: none !important;
        transition: none !important;
    }
    
}

/* Additional Performance Optimizations for Very Small Screens */
@media screen and (max-width: 330px) {
    
    /* Reduce CPU intensive properties */
    * {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Optimize scroll performance */
    body {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: auto;
    }
    
    /* Optimize images */
    img {
        -webkit-optimize-contrast: auto;
        image-rendering: -webkit-optimize-contrast;
    }
    
    /* Reduce shadow complexity */
    .shadow, .shadow-sm, .shadow-lg {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    }
    
}