/* Mobile-First Responsive Utilities */

/* Breakpoint Variables (for reference) */
/* 
   Mobile: 0px - 575px
   Tablet: 576px - 991px  
   Desktop: 992px+
   Large Desktop: 1200px+
*/

/* Container Utilities - Mobile First */
.container-fluid-custom {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 576px) {
    .container-fluid-custom {
        padding: 0 1.5rem;
    }
}

@media (min-width: 992px) {
    .container-fluid-custom {
        padding: 0 2rem;
    }
}

/* Touch-Friendly Sizing */
.touch-target {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.touch-friendly-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    min-height: 48px;
}

@media (max-width: 575px) {
    .touch-friendly-btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        min-height: 52px;
        width: 100%;
    }
}

/* Display Utilities - Mobile First */
.d-mobile-only {
    display: block;
}

.d-tablet-up {
    display: none;
}

.d-desktop-up {
    display: none;
}

.d-mobile-none {
    display: none;
}

@media (min-width: 576px) {
    .d-tablet-up {
        display: block;
    }
    
    .d-mobile-only {
        display: none;
    }
}

@media (min-width: 992px) {
    .d-desktop-up {
        display: block;
    }
    
    .d-tablet-only {
        display: none;
    }
}

@media (max-width: 575px) {
    .d-mobile-none {
        display: none !important;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .d-tablet-only {
        display: block;
    }
    
    .d-tablet-none {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .d-desktop-none {
        display: none !important;
    }
}

/* Text Utilities */
.text-mobile-center {
    text-align: center;
}

.text-mobile-left {
    text-align: left;
}

@media (min-width: 768px) {
    .text-tablet-center {
        text-align: center;
    }
    
    .text-tablet-left {
        text-align: left;
    }
    
    .text-mobile-center {
        text-align: left;
    }
}

@media (min-width: 1024px) {
    .text-desktop-center {
        text-align: center;
    }
    
    .text-desktop-left {
        text-align: left;
    }
}

/* Mobile-First Spacing Utilities */
/* Base mobile spacing (0-575px) */
.p-mobile-1 { padding: 0.5rem; }
.p-mobile-2 { padding: 1rem; }
.p-mobile-3 { padding: 1.5rem; }
.p-mobile-4 { padding: 2rem; }

.m-mobile-1 { margin: 0.5rem; }
.m-mobile-2 { margin: 1rem; }
.m-mobile-3 { margin: 1.5rem; }
.m-mobile-4 { margin: 2rem; }

/* Mobile padding overrides for better touch experience */
.px-mobile-safe { padding-left: 1rem; padding-right: 1rem; }
.py-mobile-safe { padding-top: 1rem; padding-bottom: 1rem; }

/* Tablet spacing (576px+) */
@media (min-width: 576px) {
    .p-tablet-1 { padding: 0.5rem; }
    .p-tablet-2 { padding: 1rem; }
    .p-tablet-3 { padding: 1.5rem; }
    .p-tablet-4 { padding: 2rem; }
    .p-tablet-5 { padding: 3rem; }
    
    .m-tablet-1 { margin: 0.5rem; }
    .m-tablet-2 { margin: 1rem; }
    .m-tablet-3 { margin: 1.5rem; }
    .m-tablet-4 { margin: 2rem; }
    .m-tablet-5 { margin: 3rem; }
    
    .px-mobile-safe { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* Desktop spacing (992px+) */
@media (min-width: 992px) {
    .p-desktop-1 { padding: 0.5rem; }
    .p-desktop-2 { padding: 1rem; }
    .p-desktop-3 { padding: 1.5rem; }
    .p-desktop-4 { padding: 2rem; }
    .p-desktop-5 { padding: 3rem; }
    .p-desktop-6 { padding: 4rem; }
    
    .m-desktop-1 { margin: 0.5rem; }
    .m-desktop-2 { margin: 1rem; }
    .m-desktop-3 { margin: 1.5rem; }
    .m-desktop-4 { margin: 2rem; }
    .m-desktop-5 { margin: 3rem; }
    .m-desktop-6 { margin: 4rem; }
    
    .px-mobile-safe { padding-left: 2rem; padding-right: 2rem; }
}

/* Grid Utilities */
.grid-mobile-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.grid-mobile-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .grid-tablet-1 {
        grid-template-columns: 1fr;
    }
    
    .grid-tablet-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-tablet-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-desktop-1 {
        grid-template-columns: 1fr;
    }
    
    .grid-desktop-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-desktop-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-desktop-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Flex Utilities */
.flex-mobile-column {
    display: flex;
    flex-direction: column;
}

.flex-mobile-row {
    display: flex;
    flex-direction: row;
}

@media (min-width: 768px) {
    .flex-tablet-column {
        flex-direction: column;
    }
    
    .flex-tablet-row {
        flex-direction: row;
    }
}

@media (min-width: 1024px) {
    .flex-desktop-column {
        flex-direction: column;
    }
    
    .flex-desktop-row {
        flex-direction: row;
    }
}

/* Width Utilities */
.w-mobile-full { width: 100%; }
.w-mobile-auto { width: auto; }

@media (min-width: 768px) {
    .w-tablet-25 { width: 25%; }
    .w-tablet-50 { width: 50%; }
    .w-tablet-75 { width: 75%; }
    .w-tablet-full { width: 100%; }
    .w-tablet-auto { width: auto; }
}

@media (min-width: 1024px) {
    .w-desktop-25 { width: 25%; }
    .w-desktop-33 { width: 33.333%; }
    .w-desktop-50 { width: 50%; }
    .w-desktop-66 { width: 66.666%; }
    .w-desktop-75 { width: 75%; }
    .w-desktop-full { width: 100%; }
    .w-desktop-auto { width: auto; }
}

/* Font Size Utilities */
.fs-mobile-sm { font-size: 0.875rem; }
.fs-mobile-base { font-size: 1rem; }
.fs-mobile-lg { font-size: 1.125rem; }
.fs-mobile-xl { font-size: 1.25rem; }

@media (min-width: 768px) {
    .fs-tablet-sm { font-size: 0.875rem; }
    .fs-tablet-base { font-size: 1rem; }
    .fs-tablet-lg { font-size: 1.125rem; }
    .fs-tablet-xl { font-size: 1.25rem; }
    .fs-tablet-2xl { font-size: 1.5rem; }
}

@media (min-width: 1024px) {
    .fs-desktop-sm { font-size: 0.875rem; }
    .fs-desktop-base { font-size: 1rem; }
    .fs-desktop-lg { font-size: 1.125rem; }
    .fs-desktop-xl { font-size: 1.25rem; }
    .fs-desktop-2xl { font-size: 1.5rem; }
    .fs-desktop-3xl { font-size: 1.875rem; }
    .fs-desktop-4xl { font-size: 2.25rem; }
}

/* Mobile-First Visibility Utilities */
.visible-mobile { display: block; }
.hidden-mobile { display: none; }

@media (min-width: 576px) {
    .visible-tablet { display: block; }
    .hidden-tablet { display: none; }
    .visible-mobile { display: none; }
    .hidden-mobile { display: block; }
}

@media (min-width: 992px) {
    .visible-desktop { display: block; }
    .hidden-desktop { display: none; }
    .visible-tablet { display: none; }
    .hidden-tablet { display: block; }
}

/* Touch and Interaction Utilities */
.touch-scroll {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
}

.no-touch-callout {
    -webkit-touch-callout: none;
}

.no-user-select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mobile-Optimized Interactions */
@media (max-width: 575px) {
    /* Larger tap targets for mobile */
    .btn, .nav-link, .form-control, .card {
        min-height: 44px;
    }
    
    /* Better spacing for mobile forms */
    .form-group, .mb-3 {
        margin-bottom: 1.5rem;
    }
    
    /* Mobile-friendly modal */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    /* Mobile card spacing */
    .card {
        margin-bottom: 1.5rem;
    }
    
    /* Mobile typography adjustments */
    h1 { font-size: 2rem; line-height: 1.2; }
    h2 { font-size: 1.75rem; line-height: 1.3; }
    h3 { font-size: 1.5rem; line-height: 1.3; }
    
    /* Mobile button improvements */
    .btn-group-vertical .btn {
        margin-bottom: 0.5rem;
    }
    
    /* Mobile table responsiveness */
    .table-responsive {
        border: none;
    }
}

/* Tablet-specific optimizations */
@media (min-width: 576px) and (max-width: 991px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    /* Tablet grid adjustments */
    .col-tablet-full {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .col-tablet-half {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Desktop enhancements */
@media (min-width: 992px) {
    /* Hover effects only on desktop */
    .hover-lift:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .hover-scale:hover {
        transform: scale(1.02);
    }
    
    /* Desktop-specific animations */
    .desktop-animate {
        transition: all 0.3s ease;
    }
}

/* Print styles */
@media print {
    .d-print-none {
        display: none !important;
    }
    
    .navbar, .footer, .btn, .modal {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}