/* ==============================
    CONTENEDOR PRINCIPAL Y LISTA
============================== */
.dp-lista {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.subtitulo-global {
    text-align: center;
    color: #6b7280;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    font-weight: 400;
    z-index: 3;
    font-weight: bold;
}

/* ==============================
    BARRA DE BÚSQUEDA Y FILTROS
============================== */
.barra-busqueda-dp-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2.5rem;
    width: 100%;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.barra-busqueda-dp-wrapper {
    position: relative;
    z-index: 10;   
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center; 
    flex-wrap: wrap;        
    gap: 15px;               
    background: white;
    padding: 20px 25px;
    border-radius: 16px;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.barra-filtros-fecha {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.barra-busqueda-dp-select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    font-weight: 500;
}

.barra-busqueda-dp-select:focus {
    outline: none;
    border-color: #861542;
    box-shadow: 0 0 0 3px rgba(134, 21, 66, 0.15);
}

.barra-busqueda-dp-select.mes {
    min-width: 150px;
}

.buscador-dp-resultados-info {
    text-align: center;
    color: #861542;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 10px auto 25px auto;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 8px 16px;
    border-radius: 15px;
    display: inline-block;
    border: 1px solid rgba(134, 21, 66, 0.1);
    z-index: 10;
    position: relative;
}

.barra-buscador-texto {
    display: flex;
    align-items: center;
    flex: 1;
    position: relative;
    min-width: 300px;
    z-index: 3;
}

.barra-buscador-texto .barra-busqueda-dp-input {
    width: 100%;
    padding: 14px 50px 14px 50px; 
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1.1rem;
    background: #ffffff;
    transition: all 0.3s ease;
    font-weight: 500;
    z-index: 3;
}

.barra-buscador-texto .barra-busqueda-dp-input:focus {
    outline: none;
    border-color: #861542;
    box-shadow: 0 4px 12px rgba(134, 21, 66, 0.15);
}

.barra-buscador-texto .barra-busqueda-dp-icon {
    position: absolute;
    left: 18px; 
    top: 50%;
    transform: translateY(-50%);
    color: #777;
    font-size: 1.2rem;
    z-index: 4; 
}

.buscador-clear-dp {
    position: absolute;
    right: 10px; 
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4; 
}

.buscador-clear-dp:hover {
    color: #d32f2f;
}

.dp-btn-buscar {
    background-color: #861542; 
    color: white;
    border: none;
    border-radius: 12px; 
    padding: 14px 20px; 
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex; 
    align-items: center;
    gap: 8px; 
    flex-shrink: 0; 
    margin-left: 15px; 
    box-shadow: 0 4px 10px rgba(134, 21, 66, 0.3);
}

.dp-btn-buscar:hover {
    background-color: #6e1136; 
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(134, 21, 66, 0.4);
}

.dp-btn-buscar svg {
    font-size: 1.1rem; 
}

.btn-limpiar-filtros {
    background-color: #f8d7da;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #721c24;
    transition: all 0.3s ease;
    margin-left: 5px; 
}
   
.btn-limpiar-filtros:hover {
    background-color: #f1b0b7; 
    transform: scale(1.1);       
}

/* ==============================
    TARJETAS DE PROYECTO
============================== */
.dp-card {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 1px solid #e1e5e9;
    border-radius: 10px;
    margin-bottom: 24px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    z-index: 3;
}

.dp-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.dp-card.dp-card-desbloqueado {
    border-left: 4px solid #ffc107;;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
}

.dp-card:not(.dp-card-desbloqueado) {
    border-left: 4px solid #28a745;
}

/* Header de la tarjeta */
.dp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 1px solid #e2e8f0;
}

.dp-proyecto-info {
    flex: 1;
}

.dp-proyecto-nombre {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.3;
    text-transform: uppercase;
}

.dp-proyecto-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.dp-tareas-count {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #000;
    background: white;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.dp-tareas-icon {
    color: #28a745;
    font-size: 0.8rem;
}

/* Estado del proyecto */
.dp-estado-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.dp-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dp-status-bloqueado {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
}

.dp-status-desbloqueado {
    background: #fff4d4;
    color: #ffc107;
    border: 1px solid #ffc107;
}

.dp-status-icon {
    font-size: 0.9rem;
}

/* ==============================
    SECCIÓN DE TAREAS
============================== */
.dp-tareas-section {
    padding: 24px;
    background: white;
}

.dp-tareas-header {
    margin-bottom: 20px;
    text-align: center;
}

.dp-tareas-titulo {
    font-size: 1.2rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.dp-tareas-subtitulo {
    font-size: 0.9rem;
    color: #6b7280;
}

.dp-tareas-lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dp-tarea-item {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.dp-tarea-item:hover {
    background: #f8fafc;
    border-color: #d1d5db;
    transform: translateX(4px);
}

.dp-tarea-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    gap: 16px;
}

.dp-tarea-info {
    flex: 1;
    min-width: 0; /* Permite que el texto se trunque */
}

.dp-tarea-nombre {
    font-weight: 500;
    color: #000;
    font-size: 0.95rem;
    line-height: 1;
    word-wrap: break-word;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-transform: uppercase;
}

.dp-tarea-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0; 
}

/* Botón de evidencias */
.dp-btn-evidencias {
    background: #ffc107;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 120px;
}

.dp-btn-evidencias:hover {
    background: #ffc107;
    transform: translateY(-1px);
}

/* Checkbox container */
.dp-checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    white-space: nowrap; /* Por defecto en desktop no se rompe */
    flex-shrink: 0;
    min-width: 140px;
}

.dp-checkbox-container:hover {
    background: #f3f4f6;
}

.dp-checkbox-container input[type="checkbox"] {
    display: none;
}

.dp-checkbox-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.dp-checkbox-container input[type="checkbox"]:checked + .dp-checkbox-checkmark {
    background: #10b981;
    border-color: #10b981;
}

.dp-checkbox-container input[type="checkbox"]:checked + .dp-checkbox-checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dp-checkbox-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 500;
}

.dp-checkbox-container input[type="checkbox"]:checked ~ .dp-checkbox-label {
    color: #10b981;
    font-weight: 600;
}

/* ==============================
    BOTONES DE ACCIÓN 
============================== */
.dp-accion-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.dp-btn-accion-principal {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 200px;
    justify-content: center;
}

.dp-btn-accion-secundaria {
    background-color: #f59e0b;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    min-width: 140px;
    transition: all 0.3s ease;
}

.dp-btn-accion-secundaria:hover {
    background-color: #d97706;
}

.dp-btn-desbloqueado {
    background: #28a745;
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.dp-btn-desbloqueado:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.dp-btn-bloqueado {
    background: #ffc107;
    color: white;
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.dp-btn-bloqueado:hover {
    background: #ffc107;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
}

.dp-btn-icon {
    font-size: 1rem;
}

.dp-accion-nota {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 8px;
    font-style: italic;
}

/* ==============================
    MODAL DE DETALLE 
============================== */
.dp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.dp-modal-content {
    background: white;
    border-radius: 16px;
    padding: 0;
    width: 100%;
    max-width: 900px;
    max-height: 95vh; 
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden; 
}

.dp-modal-header {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: white;
    flex-shrink: 0;
}

.dp-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    text-transform: uppercase;
}

.dp-modal-estatus {
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.dp-modal-cerrar {
    background: #4a5568;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.dp-modal-cerrar:hover {
    background: #2d3748;
    transform: rotate(90deg);
}

.dp-evidencias-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    flex: 1;
    overflow-y: auto; 
}

.dp-evidencias-navegacion {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px; 
}

.dp-imagen-container {
    width: 100%;
    max-height: 65vh; 
    min-height: 200px; 
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background: #f8fafc; 
    border: 1px solid #e2e8f0;
    position: relative;
}

.dp-imagen-evidencia {
    max-width: 100%;
    max-height: 65vh; 
    object-fit: contain; 
    display: block;
}

.dp-btn-navegacion {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8); 
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    color: #4a5568;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 10;
}

.dp-btn-navegacion:hover {
    background: #fff;
    color: #861542; 
    transform: translateY(-50%) scale(1.1);
}

.dp-btn-prev { left: 10px; }
.dp-btn-next { right: 10px; }

.dp-evidencias-info {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dp-error-placeholder {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    padding: 2rem;
    color: #94a3b8;
}
.dp-error-placeholder h4 { margin: 0; font-size: 1rem; color: #64748b; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================================
   RESPONSIVE DESIGN (MÓVILES Y TABLETS) - CORREGIDO
======================================================== */
@media (max-width: 768px) {
    /* --- AJUSTES BUSCADOR Y FILTROS --- */
    .barra-busqueda-dp-container {
        padding: 0 16px;
        margin-bottom: 2rem;
    }
  
    .barra-busqueda-dp-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 15px;
        max-width: 100%;
    }
  
    .barra-filtros-fecha {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr auto;
        gap: 8px;
    }
  
    .barra-busqueda-dp-select, 
    .barra-busqueda-dp-select.mes {
        width: 100%;
        min-width: 0;
        flex: 1;
        font-size: 1rem;
    }
  
    .barra-buscador-texto {
        width: 100%;
        margin-top: 5px;
        min-width: auto;
    }

    .dp-btn-buscar {
        width: 100%; 
        margin-left: 0;
        justify-content: center;
        margin-top: 5px;
    }

    .subtitulo-global {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    /* --- AJUSTES LISTA Y TARJETAS --- */
    .dp-lista {
        padding: 0 10px;
    }
    
    .dp-card-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        padding: 15px;
    }
    
    .dp-estado-container {
        align-items: flex-start;
    }
    
    .dp-proyecto-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .dp-proyecto-nombre {
        font-size: 1.1rem;
        word-break: break-word;
    }
    
    /* --- AJUSTES TAREAS (Corrección de Checkbox) --- */
    .dp-tarea-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .dp-tarea-info {
        width: 100%;
    }
    
    .dp-tarea-actions {
        width: 100%;
        flex-direction: column; /* Apilar elementos verticalmente */
        align-items: stretch;
        gap: 10px;
        justify-content: flex-start;
    }
    
    .dp-btn-evidencias {
        min-width: auto;
        width: 100%;
        text-align: center;
    }
    
    /* FIX CHECKBOX: Permitir que el texto se ajuste y no se corte */
    .dp-checkbox-container {
        width: 100%;
        justify-content: flex-start;
        white-space: normal; /* <--- CLAVE: Permite salto de línea */
        height: auto;
        min-width: unset;
        text-align: left;
    }

    .dp-checkbox-label {
        font-size: 0.8rem; /* Texto un poco más pequeño en móvil */
        line-height: 1.3;
    }
    
    /* --- AJUSTES MODAL --- */
    .dp-modal-content {
        width: 100%;
        margin: 10px;
    }
    
    .dp-btn-navegacion {
        width: 40px;
        height: 40px;
    }
    
    .dp-imagen-container {
        height: 300px;
    }

   
    .dp-accion-container {
        flex-direction: column-reverse; 
        gap: 10px;
    }

    .dp-btn-accion-principal, 
    .dp-btn-accion-secundaria {
        width: 100%;
        min-width: unset;
        padding: 14px;
    }
}

@media (max-width: 480px) {
    .barra-filtros-fecha {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .barra-busqueda-dp-select {
        width: 100%;
    }
    
    .barra-busqueda-dp-wrapper {
        padding: 16px;
    }
    
    .barra-buscador-texto .barra-busqueda-dp-input {
        padding: 12px 16px 12px 45px;
        font-size: 1rem;
    }

    .dp-proyecto-meta {
        font-size: 0.8rem;
    }
    
    .dp-tareas-count {
        width: 100%;
        justify-content: center;
    }
}