/* ===== OPTIMIZACIÓN DE TABLAS PARA MÓVIL - MI_PERFIL.PHP ===== */

/* ========================================
   FULL WIDTH PARA PROYECTOS EN MÓVILES
   ======================================== */
@media (max-width: 767.98px) {
    /* Hacer que los proyectos ocupen todo el ancho */
    .col-lg-8.col-xl-9 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Eliminar padding lateral en móviles */
    .container-fluid {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Hacer que las cards ocupen todo el ancho */
    .card.card-modern {
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
    }
    
    /* Eliminar gaps entre elementos */
    .row.g-4 {
        --bs-gutter-x: 0 !important;
        --bs-gutter-y: 0.5rem !important;
    }
    
    /* Hacer que las columnas ocupen todo el ancho */
    .col-12 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Ajustar el contenido de las cards */
    .card-body {
        padding: 1rem 0.75rem !important;
    }
    
    /* Hacer que las tablas ocupen todo el ancho disponible */
    .table-responsive {
        margin-left: -0.75rem !important;
        margin-right: -0.75rem !important;
        width: calc(100% + 1.5rem) !important;
    }
    
    /* Ajustar el sidebar para que no interfiera */
    .col-lg-4.col-xl-3 {
        margin-bottom: 1rem;
    }
}

/* Estilos generales para tablas en móvil */
@media (max-width: 991.98px) {
    /* Contenedor de tabla responsive */
    .table-responsive {
        border: none;
        border-radius: 8px;
        overflow: hidden;
    }
    
    /* Tabla base */
    .table-modern {
        font-size: 0.875rem;
        margin-bottom: 0;
    }
    
    /* Header de tabla */
    .table-modern thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 2px solid rgba(255,255,255,0.2);
    }
    
    /* Celdas de tabla */
    .table-modern td {
        padding: 0.75rem 0.5rem;
        vertical-align: middle;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    /* Ocultar columnas menos importantes en móvil */
    .table-modern th:nth-child(2), /* Cliente */
    .table-modern td:nth-child(2) {
        display: none;
    }
    
    /* Ajustar columna de acciones */
    .table-modern th:last-child,
    .table-modern td:last-child {
        text-align: center !important;
        width: auto;
        min-width: 120px;
    }
    
    /* Botones de acción más compactos */
    .table-modern .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
        margin: 0.125rem;
    }
    
    /* Badges más compactos */
    .table-modern .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Progress bar más compacto */
    .table-modern .progress {
        height: 16px !important;
        font-size: 0.7rem;
    }
}

/* Estilos específicos para pantallas muy pequeñas */
@media (max-width: 575.98px) {
    /* Convertir tabla en cards */
    .table-modern {
        display: block;
        background: transparent;
    }
    
    .table-modern thead {
        display: none; /* Ocultar header en móvil */
    }
    
    .table-modern tbody {
        display: block;
    }
    
    .table-modern tr {
        display: block;
        background: rgba(255,255,255,0.05);
        border-radius: 8px;
        margin-bottom: 1rem;
        padding: 1rem;
        border: 1px solid rgba(255,255,255,0.1);
    }
    
    .table-modern td {
        display: block;
        border: none;
        padding: 0.5rem 0;
        text-align: left;
    }
    
    /* Etiquetas para cada campo */
    .table-modern td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #deacf8;
        display: inline-block;
        width: 80px;
        margin-right: 0.5rem;
    }
    
    /* Ajustar columna de acciones */
    .table-modern td:last-child {
        text-align: center;
        padding-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.1);
        margin-top: 0.5rem;
    }
    
    .table-modern td:last-child:before {
        display: none;
    }
    
    /* Botones de acción en móvil */
    .table-modern .btn {
        display: inline-block;
        margin: 0.25rem;
        min-width: 40px;
    }
    
    /* Progress bar en móvil */
    .table-modern .progress {
        margin: 0.5rem 0;
    }
}

/* Estilos específicos para la tabla de proyectos */
@media (max-width: 575.98px) {
    /* Tabla de proyectos */
    .table-modern[data-table="proyectos"] td:nth-child(1):before {
        content: "Proyecto: ";
    }
    
    .table-modern[data-table="proyectos"] td:nth-child(3):before {
        content: "Estado: ";
    }
    
    .table-modern[data-table="proyectos"] td:nth-child(4):before {
        content: "Progreso: ";
    }
    
    .table-modern[data-table="proyectos"] td:nth-child(5):before {
        content: "Entrega: ";
    }
}

/* Estilos específicos para la tabla de tareas */
@media (max-width: 575.98px) {
    /* Tabla de tareas */
    .table-modern[data-table="tareas"] td:nth-child(1):before {
        content: "Tarea: ";
    }
    
    .table-modern[data-table="tareas"] td:nth-child(3):before {
        content: "Estado: ";
    }
    
    .table-modern[data-table="tareas"] td:nth-child(4):before {
        content: "Asignado: ";
    }
    
    .table-modern[data-table="tareas"] td:nth-child(5):before {
        content: "Entrega: ";
    }
}

/* Optimizaciones para tabs en móvil */
@media (max-width: 575.98px) {
    .nav-tabs {
        flex-wrap: wrap;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
    
    .nav-tabs .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.25rem;
        border-radius: 6px;
        border: 1px solid rgba(255,255,255,0.2);
        background: rgba(255,255,255,0.05);
    }
    
    .nav-tabs .nav-link.active {
        background: #deacf8;
        color: #23272b;
        border-color: #deacf8;
    }
    
    .nav-tabs .nav-link:hover {
        background: rgba(255,255,255,0.1);
        border-color: rgba(255,255,255,0.3);
    }
}

/* Paginación optimizada para móvil */
@media (max-width: 575.98px) {
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .pagination .page-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        border-radius: 6px;
        margin: 0.125rem;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.2);
        color: white;
    }
    
    .pagination .page-link:hover {
        background: rgba(255,255,255,0.1);
        border-color: rgba(255,255,255,0.3);
    }
    
    .pagination .page-item.active .page-link {
        background: #deacf8;
        border-color: #deacf8;
        color: #23272b;
    }
    
    .pagination .page-item.disabled .page-link {
        background: rgba(255,255,255,0.02);
        border-color: rgba(255,255,255,0.1);
        color: rgba(255,255,255,0.5);
    }
}

/* Animaciones suaves */
.table-modern tr {
    transition: all 0.2s ease;
}

.table-modern tr:hover {
    background: rgba(255,255,255,0.05);
}

/* Estilos para estados vacíos */
.table-modern tbody tr td[colspan] {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(255,255,255,0.6);
    font-style: italic;
}

/* Optimizaciones para touch */
@media (hover: none) and (pointer: coarse) {
    .table-modern .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .table-modern tr {
        cursor: pointer;
    }
    
    .table-modern tr:active {
        background: rgba(255,255,255,0.1);
    }
}

/* Estilos para scroll horizontal en tablets */
@media (min-width: 576px) and (max-width: 991.98px) {
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-modern {
        min-width: 600px;
    }
    
    /* Mantener algunas columnas visibles en tablet */
    .table-modern th:nth-child(2),
    .table-modern td:nth-child(2) {
        display: table-cell;
    }
} 