/* ========================================
   Mobile-Responsive Global Styles
   Applies consistent mobile patterns across all pages
   ======================================== */

/* Mobile-first container adjustments */
@media (max-width: 575.98px) {
    .container,
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .container-md {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Reduce vertical spacing on mobile */
    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    .py-3 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1rem !important;
    }
}

/* Card adjustments for mobile */
@media (max-width: 767.98px) {
    .card {
        border-radius: 0.5rem;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    .card-header {
        padding: 0.75rem 1rem !important;
        font-size: 0.95rem;
    }
    
    .card-header h5,
    .card-header .h5 {
        font-size: 1rem !important;
    }
}

/* Button improvements for mobile touch targets */
@media (max-width: 991.98px) {
    .btn {
        min-height: 40px;
        padding: 0.5rem 1rem;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 0.375rem 0.75rem;
    }
    
    .btn-lg {
        min-height: 48px;
        padding: 0.75rem 1.5rem;
    }
    
    /* Prevent iOS zoom on focus */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="url"],
    input[type="search"],
    input[type="date"],
    input[type="datetime-local"],
    textarea,
    select {
        font-size: 16px !important;
    }
    
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px !important;
    }
    
    .form-control-sm,
    .form-select-sm {
        min-height: 36px;
        font-size: 14px !important;
    }
}

/* Table responsive patterns */
@media (max-width: 991.98px) {
    .table-responsive {
        border-radius: 0.5rem;
        margin-bottom: 0;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
        vertical-align: middle;
    }
    
    /* Hide less critical columns on mobile */
    .table .d-none-mobile {
        display: none !important;
    }
}

/* Modal improvements for mobile */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.75rem;
    }
    
    .modal-header {
        padding: 0.75rem 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        padding: 0.75rem 1rem;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
}

/* Alert improvements */
@media (max-width: 575.98px) {
    .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .alert-dismissible .btn-close {
        padding: 0.5rem;
    }
}

/* Badge and label adjustments */
@media (max-width: 575.98px) {
    .badge {
        font-size: 0.75rem;
        padding: 0.35em 0.65em;
    }
    
    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }
}

/* Navigation and header mobile patterns */
@media (max-width: 991.98px) {
    /* Stack header elements on mobile */
    .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    .d-flex.justify-content-between.mobile-row {
        flex-direction: row;
    }
    
    /* Page headers */
    h1, .h1 {
        font-size: 1.75rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    h3, .h3 {
        font-size: 1.25rem;
    }
    
    h4, .h4 {
        font-size: 1.1rem;
    }
    
    h5, .h5 {
        font-size: 1rem;
    }
}

/* Grid adjustments for better mobile stacking */
@media (max-width: 767.98px) {
    .row.g-4 {
        --bs-gutter-y: 1rem;
    }
    
    .row.g-3 {
        --bs-gutter-y: 0.75rem;
    }
    
    /* Force full width for better mobile UX */
    .col-md-6,
    .col-md-4,
    .col-md-3 {
        width: 100%;
    }
}

/* Filter pills and action buttons */
@media (max-width: 575.98px) {
    .event-filter-pills {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .filter-pill {
        flex: 1 1 auto;
        min-width: 80px;
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .pill-text {
        font-size: 0.8rem;
    }
}

/* Search and input groups */
@media (max-width: 575.98px) {
    .input-group {
        flex-wrap: nowrap;
    }
    
    .input-group-text {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .input-group .form-control {
        font-size: 16px !important;
    }
}

/* Dropdown and select improvements */
@media (max-width: 575.98px) {
    .dropdown-menu {
        width: 100%;
        max-width: 100%;
        font-size: 0.9rem;
    }
    
    .dropdown-item {
        padding: 0.75rem 1rem;
    }
}

/* Utility classes for mobile control */
.mobile-full-width {
    width: 100% !important;
}

@media (min-width: 576px) {
    .mobile-full-width {
        width: auto !important;
    }
}

.mobile-stack {
    flex-direction: column !important;
}

@media (min-width: 576px) {
    .mobile-stack {
        flex-direction: row !important;
    }
}

/* Touch-friendly spacing */
@media (max-width: 991.98px) {
    .gap-mobile-2 {
        gap: 0.5rem !important;
    }
    
    .gap-mobile-3 {
        gap: 1rem !important;
    }
}

/* Prevent text overflow */
.text-truncate-mobile {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .text-truncate-mobile {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }
}

/* Icon sizing for mobile */
@media (max-width: 575.98px) {
    .fa-2x {
        font-size: 1.5em !important;
    }
    
    .fa-3x {
        font-size: 2em !important;
    }
    
    .feature-icon {
        width: 2rem !important;
        height: 2rem !important;
        font-size: 1rem !important;
    }
}

/* Accessibility - larger touch targets */
@media (max-width: 991.98px) and (hover: none) {
    a:not(.btn),
    button:not(.btn) {
        min-height: 44px;
        min-width: 44px;
    }
}
