/**
 * Responsive Utilities for SS Infotech Website
 * Helper classes for responsive design
 * Last Updated: December 12, 2025
 */

/* ========================================
   DISPLAY UTILITIES
======================================== */

/* Hide on mobile */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 1024px) {
    .hide-desktop {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none !important;
}

@media (max-width: 767px) {
    .show-mobile {
        display: block !important;
    }

    .show-mobile-inline {
        display: inline !important;
    }

    .show-mobile-flex {
        display: flex !important;
    }
}

/* Show only on tablet */
.show-tablet {
    display: none !important;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .show-tablet {
        display: block !important;
    }

    .show-tablet-inline {
        display: inline !important;
    }

    .show-tablet-flex {
        display: flex !important;
    }
}

/* Show only on desktop */
.show-desktop {
    display: none !important;
}

@media (min-width: 1024px) {
    .show-desktop {
        display: block !important;
    }

    .show-desktop-inline {
        display: inline !important;
    }

    .show-desktop-flex {
        display: flex !important;
    }
}

/* ========================================
   TEXT ALIGNMENT UTILITIES
======================================== */

/* Mobile text alignment */
@media (max-width: 767px) {
    .text-mobile-center {
        text-align: center !important;
    }

    .text-mobile-left {
        text-align: left !important;
    }

    .text-mobile-right {
        text-align: right !important;
    }
}

/* Tablet text alignment */
@media (min-width: 768px) and (max-width: 1023px) {
    .text-tablet-center {
        text-align: center !important;
    }

    .text-tablet-left {
        text-align: left !important;
    }

    .text-tablet-right {
        text-align: right !important;
    }
}

/* Desktop text alignment */
@media (min-width: 1024px) {
    .text-desktop-center {
        text-align: center !important;
    }

    .text-desktop-left {
        text-align: left !important;
    }

    .text-desktop-right {
        text-align: right !important;
    }
}

/* ========================================
   SPACING UTILITIES
======================================== */

/* Mobile spacing */
@media (max-width: 767px) {
    .mt-mobile-0 {
        margin-top: 0 !important;
    }

    .mt-mobile-1 {
        margin-top: 0.5rem !important;
    }

    .mt-mobile-2 {
        margin-top: 1rem !important;
    }

    .mt-mobile-3 {
        margin-top: 1.5rem !important;
    }

    .mt-mobile-4 {
        margin-top: 2rem !important;
    }

    .mb-mobile-0 {
        margin-bottom: 0 !important;
    }

    .mb-mobile-1 {
        margin-bottom: 0.5rem !important;
    }

    .mb-mobile-2 {
        margin-bottom: 1rem !important;
    }

    .mb-mobile-3 {
        margin-bottom: 1.5rem !important;
    }

    .mb-mobile-4 {
        margin-bottom: 2rem !important;
    }

    .pt-mobile-0 {
        padding-top: 0 !important;
    }

    .pt-mobile-1 {
        padding-top: 0.5rem !important;
    }

    .pt-mobile-2 {
        padding-top: 1rem !important;
    }

    .pt-mobile-3 {
        padding-top: 1.5rem !important;
    }

    .pt-mobile-4 {
        padding-top: 2rem !important;
    }

    .pb-mobile-0 {
        padding-bottom: 0 !important;
    }

    .pb-mobile-1 {
        padding-bottom: 0.5rem !important;
    }

    .pb-mobile-2 {
        padding-bottom: 1rem !important;
    }

    .pb-mobile-3 {
        padding-bottom: 1.5rem !important;
    }

    .pb-mobile-4 {
        padding-bottom: 2rem !important;
    }
}

/* ========================================
   FLEXBOX UTILITIES
======================================== */

/* Mobile flex direction */
@media (max-width: 767px) {
    .flex-mobile-column {
        flex-direction: column !important;
    }

    .flex-mobile-row {
        flex-direction: row !important;
    }

    .flex-mobile-wrap {
        flex-wrap: wrap !important;
    }

    .justify-mobile-center {
        justify-content: center !important;
    }

    .justify-mobile-start {
        justify-content: flex-start !important;
    }

    .justify-mobile-end {
        justify-content: flex-end !important;
    }

    .align-mobile-center {
        align-items: center !important;
    }

    .align-mobile-start {
        align-items: flex-start !important;
    }

    .align-mobile-end {
        align-items: flex-end !important;
    }
}

/* ========================================
   WIDTH UTILITIES
======================================== */

/* Mobile widths */
@media (max-width: 767px) {
    .w-mobile-100 {
        width: 100% !important;
    }

    .w-mobile-75 {
        width: 75% !important;
    }

    .w-mobile-50 {
        width: 50% !important;
    }

    .w-mobile-auto {
        width: auto !important;
    }
}

/* ========================================
   FONT SIZE UTILITIES
======================================== */

/* Mobile font sizes */
@media (max-width: 767px) {
    .fs-mobile-xs {
        font-size: 0.75rem !important;
    }

    .fs-mobile-sm {
        font-size: 0.875rem !important;
    }

    .fs-mobile-md {
        font-size: 1rem !important;
    }

    .fs-mobile-lg {
        font-size: 1.125rem !important;
    }

    .fs-mobile-xl {
        font-size: 1.25rem !important;
    }
}

/* ========================================
   CONTAINER UTILITIES
======================================== */

/* Full width on mobile */
@media (max-width: 767px) {
    .container-mobile-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }
}

/* ========================================
   IMAGE UTILITIES
======================================== */

/* Responsive images */
.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Cover images */
.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Contain images */
.img-contain {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Mobile image adjustments */
@media (max-width: 767px) {
    .img-mobile-full {
        width: 100% !important;
        height: auto !important;
    }

    .img-mobile-center {
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* ========================================
   GRID UTILITIES
======================================== */

/* Responsive grid */
.grid-responsive {
    display: grid;
    gap: 1.5rem;
}

/* Mobile: 1 column */
@media (max-width: 479px) {
    .grid-responsive {
        grid-template-columns: 1fr;
    }
}

/* Mobile: 2 columns */
@media (min-width: 480px) and (max-width: 767px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

/* Tablet: 3 columns */
@media (min-width: 768px) and (max-width: 1023px) {
    .grid-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop: 4 columns */
@media (min-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ========================================
   OVERFLOW UTILITIES
======================================== */

/* Prevent horizontal scroll */
.no-scroll-x {
    overflow-x: hidden !important;
}

/* Prevent vertical scroll */
.no-scroll-y {
    overflow-y: hidden !important;
}

/* Enable scrolling */
.scroll-auto {
    overflow: auto !important;
}

/* Mobile scroll */
@media (max-width: 767px) {
    .scroll-mobile-x {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .scroll-mobile-y {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================
   POSITION UTILITIES
======================================== */

/* Mobile positioning */
@media (max-width: 767px) {
    .position-mobile-static {
        position: static !important;
    }

    .position-mobile-relative {
        position: relative !important;
    }

    .position-mobile-absolute {
        position: absolute !important;
    }

    .position-mobile-fixed {
        position: fixed !important;
    }
}

/* ========================================
   BORDER RADIUS UTILITIES
======================================== */

/* Mobile border radius */
@media (max-width: 767px) {
    .rounded-mobile-0 {
        border-radius: 0 !important;
    }

    .rounded-mobile-sm {
        border-radius: 0.375rem !important;
    }

    .rounded-mobile-md {
        border-radius: 0.5rem !important;
    }

    .rounded-mobile-lg {
        border-radius: 0.75rem !important;
    }

    .rounded-mobile-full {
        border-radius: 9999px !important;
    }
}

/* ========================================
   SHADOW UTILITIES
======================================== */

/* Mobile shadows */
@media (max-width: 767px) {
    .shadow-mobile-none {
        box-shadow: none !important;
    }

    .shadow-mobile-sm {
        box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    }

    .shadow-mobile-md {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    }

    .shadow-mobile-lg {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    }
}

/* ========================================
   ASPECT RATIO UTILITIES
======================================== */

/* Aspect ratio containers */
.aspect-ratio-16-9 {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
}

.aspect-ratio-4-3 {
    position: relative;
    padding-bottom: 75%;
    /* 4:3 */
    height: 0;
    overflow: hidden;
}

.aspect-ratio-1-1 {
    position: relative;
    padding-bottom: 100%;
    /* 1:1 */
    height: 0;
    overflow: hidden;
}

.aspect-ratio-16-9>*,
.aspect-ratio-4-3>*,
.aspect-ratio-1-1>* {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   TOUCH TARGET UTILITIES
======================================== */

/* Minimum touch target size */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Large touch target */
.touch-target-lg {
    min-width: 48px;
    min-height: 48px;
}

/* ========================================
   SAFE AREA UTILITIES
======================================== */

/* iOS safe area insets */
@supports (padding: max(0px)) {
    .safe-area-top {
        padding-top: max(0px, env(safe-area-inset-top));
    }

    .safe-area-bottom {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }

    .safe-area-left {
        padding-left: max(0px, env(safe-area-inset-left));
    }

    .safe-area-right {
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* ========================================
   VISIBILITY UTILITIES
======================================== */

/* Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus visible for keyboard navigation */
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ========================================
   PRINT UTILITIES
======================================== */

@media print {
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }
}

/* ========================================
   PERFORMANCE UTILITIES
======================================== */

/* GPU acceleration */
.gpu-accelerate {
    transform: translateZ(0);
    will-change: transform;
}

/* Smooth scrolling */
.smooth-scroll {
    scroll-behavior: smooth;
}

/* ========================================
   TRUNCATE TEXT UTILITIES
======================================== */

/* Single line truncate */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Multi-line truncate (2 lines) */
.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Multi-line truncate (3 lines) */
.truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   MOBILE-SPECIFIC UTILITIES
======================================== */

@media (max-width: 767px) {

    /* Stack elements vertically on mobile */
    .stack-mobile>* {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }

    .stack-mobile>*:last-child {
        margin-bottom: 0;
    }

    /* Full bleed on mobile */
    .full-bleed-mobile {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
    }

    /* Sticky on mobile */
    .sticky-mobile {
        position: sticky;
        top: 0;
        z-index: 100;
    }
}