/* ===================================
   MCA GYM - Mobile Responsive CSS
   Clean Mobile-First Approach
   =================================== */

/* ===== MOBILE GRID OVERRIDE ===== */
/* Ensure all columns are full width on mobile */
.col,
.col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
.col-7, .col-8, .col-9, .col-10, .col-11, .col-12,
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6,
.col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12 {
    width: 100% !important;
    flex: 0 0 100% !important;
    padding: 0 !important;
    margin-bottom: 12px;
}

.row {
    width: 100% !important;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    margin: 0 !important;
}

.row.g-0 > * { padding: 0; }
.row.g-1 > * { padding: 4px; }
.row.g-2 > * { padding: 8px; }
.row.g-3 > * { padding: 12px; }

/* ===== CONTAINER MOBILE ===== */
.container-fluid {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* ===== TABLE MOBILE ===== */
.table-responsive {
    margin: 8px;
    border-radius: 8px;
    overflow: visible;
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
    width: 100%;
}

.table {
    font-size: 0.85rem;
    margin-bottom: 0;
    white-space: normal;
    overflow: visible;
    width: 100%;
}

.table thead {
    display: none;
}

.table tbody {
    display: block;
    width: 100%;
}

.table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    overflow: visible;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 0;
}

.table tbody tr:hover {
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.table tbody td {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    position: relative;
    word-break: break-word;
    white-space: normal;
    overflow: visible;
    padding-left: 100px;
}

.table tbody td:first-child {
    border-top: none;
    padding-top: 10px;
}

.table tbody td:last-child {
    border-bottom: none;
    padding-bottom: 10px;
}

.table tbody td:before {
    content: attr(data-label);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #c92a2a;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Button group in table cells - CLICKABLE */
.table tbody td .btn-group {
    flex-direction: row;
    gap: 4px;
    width: 100%;
    margin-top: 8px;
    pointer-events: auto !important;
}

.table tbody td .btn-group .btn {
    flex: 1;
    padding: 10px 6px;
    font-size: 0.7rem;
    border-radius: 5px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

.table tbody td .btn-group a.btn {
    pointer-events: auto !important;
    cursor: pointer;
    text-decoration: none;
}

/* ===== CARD MOBILE ===== */
.card {
    margin: 8px 0;
    margin-bottom: 12px;
    border-radius: 10px;
    border: none;
    border-left: 5px solid #c92a2a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #ffffff;
    overflow: visible;
    pointer-events: auto;
    width: 100%;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-body {
    padding: 12px;
    overflow: visible;
    pointer-events: auto;
}

.card-header {
    padding: 12px;
    background: linear-gradient(135deg, rgba(201, 42, 42, 0.08) 0%, rgba(201, 42, 42, 0.04) 100%);
    border-bottom: 1px solid #e0e0e0;
    overflow: visible;
    pointer-events: auto;
}

/* ===== BUTTON MOBILE ===== */
.btn {
    padding: 10px 14px;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    font-weight: 500;
    min-height: 40px;
    width: auto;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: #c92a2a !important;
    color: #ffffff !important;
    border: none !important;
}

.btn-primary:hover {
    background: #a01f1f !important;
}

.btn-success {
    background: #2f9e44 !important;
    color: #ffffff !important;
}

.btn-success:hover {
    background: #237c34 !important;
}

.btn-info {
    background: #1971c2 !important;
    color: #ffffff !important;
}

.btn-info:hover {
    background: #135aa1 !important;
}

.btn-warning {
    background: #fd7e14 !important;
    color: #ffffff !important;
}

.btn-warning:hover {
    background: #e86b00 !important;
}

.btn-secondary {
    background: #6c757d !important;
    color: #ffffff !important;
}

.btn-secondary:hover {
    background: #5a6268 !important;
}

.w-100 {
    width: 100% !important;
}

/* ===== BUTTON GROUP MOBILE ===== */
.btn-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.btn-group.btn-group-sm .btn {
    padding: 8px 10px;
    font-size: 0.75rem;
    min-height: 36px;
}

/* ===== FORM MOBILE ===== */
.form-label {
    font-size: 0.85rem;
    color: #2d3436;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-control,
.form-select {
    padding: 10px 12px;
    font-size: 0.9rem;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #ffffff;
    color: #2d3436;
    width: 100%;
    min-height: 40px;
}

.form-control:focus,
.form-select:focus {
    border-color: #c92a2a;
    box-shadow: 0 0 0 0.2rem rgba(201, 42, 42, 0.1);
}

/* ===== MODAL MOBILE ===== */
.modal-dialog {
    max-width: 95% !important;
    width: 95% !important;
    margin: 12px auto !important;
    display: block !important;
    visibility: visible !important;
}

.modal {
    display: none !important;
}

.modal.show {
    display: block !important;
}

.modal-content {
    border-radius: 10px;
    border: none;
    border-left: 5px solid #c92a2a;
    overflow: visible;
    display: block !important;
}

.modal-header {
    padding: 12px;
    background: linear-gradient(135deg, rgba(201, 42, 42, 0.1) 0%, rgba(201, 42, 42, 0.05) 100%);
    border-bottom: 1px solid #e0e0e0;
}

.modal-body {
    padding: 14px;
    max-height: 75vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-body .row > div {
    width: 100% !important;
    flex: 0 0 100%;
}

/* ===== ALERT MOBILE ===== */
.alert {
    margin: 8px 0;
    padding: 12px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
    border-left: 4px solid;
    width: 100%;
}

.alert-success {
    background: rgba(47, 158, 68, 0.1);
    color: #2f9e44;
    border-left-color: #2f9e44;
}

.alert-danger {
    background: rgba(201, 42, 42, 0.1);
    color: #c92a2a;
    border-left-color: #c92a2a;
}

/* ===== UTILITIES ===== */
.text-muted {
    color: #666 !important;
}

.mb-3 {
    margin-bottom: 12px !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mt-1 {
    margin-top: 4px !important;
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

/* ===== TABLET (768px+) ===== */
@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 calc(100% / 12); width: auto; }
    .col-md-2 { flex: 0 0 calc(200% / 12); width: auto; }
    .col-md-3 { flex: 0 0 calc(300% / 12); width: auto; }
    .col-md-4 { flex: 0 0 calc(400% / 12); width: auto; }
    .col-md-5 { flex: 0 0 calc(500% / 12); width: auto; }
    .col-md-6 { flex: 0 0 calc(600% / 12); width: auto; }
    .col-md-7 { flex: 0 0 calc(700% / 12); width: auto; }
    .col-md-8 { flex: 0 0 calc(800% / 12); width: auto; }
    .col-md-9 { flex: 0 0 calc(900% / 12); width: auto; }
    .col-md-10 { flex: 0 0 calc(1000% / 12); width: auto; }
    .col-md-11 { flex: 0 0 calc(1100% / 12); width: auto; }
    .col-md-12 { flex: 0 0 100%; width: 100%; }
    
    .row {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .table thead {
        display: table-header-group;
    }
    
    .table thead th {
        padding: 12px;
        font-weight: 600;
        background: linear-gradient(135deg, rgba(201, 42, 42, 0.1) 0%, rgba(201, 42, 42, 0.05) 100%);
        color: #c92a2a;
        border-bottom: 2px solid #c92a2a;
    }
    
    .table tbody {
        display: table-row-group;
    }
    
    .table tbody tr {
        display: table-row;
        background: #ffffff;
        border: none;
        margin-bottom: 0;
        box-shadow: none;
        padding: 0;
    }
    
    .table tbody tr:hover {
        background: rgba(201, 42, 42, 0.04);
        box-shadow: none;
    }
    
    .table tbody td {
        display: table-cell;
        padding: 12px;
        border-bottom: 1px solid #f0f0f0;
        text-align: left;
        word-break: normal;
        white-space: nowrap;
        padding-left: 12px;
    }
    
    .table tbody td:before {
        display: none;
    }
    
    .table tbody td .btn-group {
        flex-direction: row;
        width: auto;
        gap: 4px;
        margin-top: 0;
    }
    
    .table tbody td .btn-group .btn {
        flex: 0 1 auto;
        width: auto;
        min-width: 80px;
        padding: 8px 12px;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    .btn-group {
        flex-direction: row;
        width: auto;
    }
    
    .btn-group .btn {
        flex: 1 1 auto;
        width: auto;
        min-width: 80px;
        padding: 8px 12px;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    .modal-dialog {
        max-width: 600px !important;
        width: 90% !important;
    }
    
    .container-fluid {
        padding: 0;
        max-width: 100%;
    }
    
    .card {
        margin: 12px 0;
        margin-bottom: 20px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 38px;
    }
}

/* ===== DESKTOP (1024px+) ===== */
@media (min-width: 1024px) {
    .container-fluid {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0;
    }
    
    .card {
        margin: 15px 0;
    }
    
    .modal-dialog {
        max-width: 800px !important;
    }
}
