/* Mobile Responsive Enhancements for Gym Management System */

/* General responsive improvements */
@media (max-width: 767.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    h1, .h1 {
        font-size: 1.75rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    /* Improve table display on mobile */
    .table-responsive {
        margin-bottom: 0;
    }
    
    /* Card improvements */
    .card {
        margin-bottom: 1rem;
    }
    
    /* Improve form elements on mobile */
    .form-control, .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Fix button spacing */
    .btn-toolbar .btn-group {
        margin-bottom: 0.5rem;
    }
    
    /* Adjust footer */
    .footer {
        margin-top: 20px;
        padding: 15px 0;
    }
    
    /* Make buttons more tappable */
    .btn {
        padding: 0.5rem 0.75rem;
    }
    
    /* Improve nav dropdown on mobile */
    .navbar-collapse {
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* Fix margins and paddings */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .pt-3 {
        padding-top: 0.75rem !important;
    }
    
    /* Improve card headers */
    .card-header {
        padding: 0.75rem;
    }
    
    /* Mobile optimized tables */
    .mobile-table thead {
        display: none;
    }
    
    .mobile-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: 0.25rem;
    }
    
    .mobile-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-bottom: 1px solid #dee2e6;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    
    .mobile-table tbody td:last-child {
        border-bottom: none;
    }
    
    .mobile-table tbody td:before {
        content: attr(data-label);
        position: absolute;
        left: 0.75rem;
        width: 45%;
        padding-right: 0.5rem;
        font-weight: bold;
        text-align: left;
    }
}

/* Extra small devices (portrait phones) */
@media (max-width: 575.98px) {
    /* Further reductions for very small screens */
    h1, .h1 {
        font-size: 1.5rem;
    }
    
    h2, .h2 {
        font-size: 1.25rem;
    }
    
    /* Optimize dashboard cards */
    .stat-card {
        padding: 0.5rem;
    }
    
    .stat-card .display-4 {
        font-size: 1.75rem;
    }
    
    /* Language selector adjustments */
    .btn-group .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    /* Fix chart container heights */
    .chart-container {
        height: 250px !important;
    }
    
    /* Space-saving for small profile sections */
    .text-center img.rounded-circle {
        max-width: 100px !important;
    }
}

/* RTL specific mobile fixes */
@media (max-width: 767.98px) {
    html[dir="rtl"] .mobile-table tbody td {
        padding-right: 50%;
        padding-left: 0.75rem;
        text-align: left;
    }
    
    html[dir="rtl"] .mobile-table tbody td:before {
        right: 0.75rem;
        left: auto;
        text-align: right;
    }
}

/* Special handling for tables on mobile - makes data accessible */
.mobile-optimized-table {
    width: 100%;
}

/* Calendar display improvements */
@media (max-width: 767.98px) {
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .fc .fc-toolbar-title {
        font-size: 1.25rem;
    }
    
    .fc .fc-button {
        padding: 0.4rem 0.65rem;
        font-size: 0.9rem;
    }
}

/* Progress charts responsive improvements */
@media (max-width: 767.98px) {
    .progress {
        height: 1.25rem;
    }
    
    .progress-bar {
        font-size: 0.8rem;
    }
}

/* Make modals better on small screens */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-header {
        padding: 0.75rem;
    }
    
    .modal-body {
        padding: 0.75rem;
    }
    
    .modal-footer {
        padding: 0.75rem;
    }
}

/* Improve form layouts on mobile */
@media (max-width: 767.98px) {
    .form-label {
        margin-bottom: 0.25rem;
    }
    
    .form-check {
        padding-left: 1.75rem;
    }
    
    .form-check-input {
        margin-top: 0.25rem;
    }
}

/* Fix for touch input on mobile */
@media (max-width: 767.98px) {
    input, select, textarea {
        font-size: 16px !important;
    }
    
    .select2-container--default .select2-selection--single {
        height: 38px;
        padding-top: 4px;
    }
} 